Files
mraa/examples/javascript/isr.js
Thomas Ingleby 170bdd104f spdx: add spdx tags to most files
Large change that removes the duplicated MIT notice withe a spdx tag

Signed-off-by: Thomas Ingleby <thomas.ingleby@intel.com>
2019-05-23 10:09:12 -07:00

24 lines
484 B
JavaScript

#!/usr/bin/env node
/*
* Copyright (c) 2015 Intel Corporation.
*
* SPDX-License-Identifier: MIT
*/
"use strict";
const mraa = require('mraa');
function hello() {
console.log("HELLO!!!!");
}
let pin = new mraa.Gpio(14);
pin.isr(mraa.EDGE_BOTH, hello);
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 " + pin.getPin() + "...");
}, 10000);