mirror of
https://github.com/eclipse/mraa.git
synced 2025-10-18 00:51:25 +08:00

Closes #403. Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
17 lines
349 B
JavaScript
17 lines
349 B
JavaScript
#!/usr/bin/env node
|
|
|
|
var m = require('mraa')
|
|
|
|
function h() {
|
|
console.log("HELLO!!!!")
|
|
}
|
|
|
|
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)
|