diff --git a/examples/javascript/isr.js b/examples/javascript/isr.js index d400c0d23..9abcb1fc2 100644 --- a/examples/javascript/isr.js +++ b/examples/javascript/isr.js @@ -8,3 +8,9 @@ function h() { x = new m.Gpio(14) x.isr(m.EDGE_BOTH, h) + +setInterval(function() { + // It's important to refer to our GPIO context here, + // otherwise it will be garbage-collected + console.log("Waiting for an interrupt at GPIO pin " + x.getPin() + "...") +}, 10000)