A node.js based project that demonstrates how to call an ISR when an interrupt occurs.
Clone or download
Pull request Compare This branch is even with gomobile:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE.md
README.md
app.json
icon.png
isr.xdk
main.js
package.json

README.md

ISR - Interrupt Service Routine

A simple node.js application that demonstrates how to call an ISR when an interrupt occurs.

An interrupt service routine (ISR) is a software routine that hardware invokes in response to an interrupt. ISRs examine an interrupt and determine how to handle it. ISRs handle the interrupt, and then return a logical interrupt value.

First, you need to identify the desired GPIO pin being observed to trigger an interrupt if the pin is low, high or changed. Besides the trigger, you will need to declare a function to call when the interrupt occurs.

var m = require('mraa');
var x = new m.Gpio(8); //GPIO Pin 8
x.isr(mode, function(){}); //mode = m.EDGE_BOTH, m.EDGE_RISING, m.EDGE_NONE, or m.EDGE_FALLING

###Intel(R) Edison & Intel(R) Galileo In regards to Intel(R) Edison, all GPIO inputs on the Edison platform are interrupt-capable, and all interrupt types are supported on all inputs. libmraa is required in order to get started.

Note: Intel(R) Galileo Gen1, Gen2, and Intel(R) Edison only supports EDGE_BOTH with the javascript implementation of mraa.

For more information on a GPIO pin Guide, visit http://www.emutexlabs.com/project/215-intel-edison-gpio-pin-multiplexing-guide.

Intel(R) XDK

This template is part of the Intel(R) XDK IoT Edition. Download the Intel(R) XDK at http://software.intel.com/en-us/html5. To see the technical details of the sample, please visit the sample article page at https://software.intel.com/en-us/node-js-templates-for-intel-xdk-iot-edition.

Important App Files

  • main.js
  • package.json
  • README.md

mraa

  • Included on the IoTDevkit Linux Image