fastgpio

a nodejs gpio library for the raspberry pi using the fastest way to export values

node-fast-gpio

This is a small node.js GPIO library for the Raspberry Pi using the fastest way to export values via C (http://codeandlife.com/2012/07/03/benchmarking-raspberry-pi-gpio-speed/).

Clone the repository after that use

$ chmod +x configure.sh
$ ./configure.sh

to install node-gyp and build the library.

In your node.js file just require the library:

var gpioexport = require( __dirname + "/libc/build/Release/gpioexport" );

Now you can prepare your GPIO for output using:

gpioexport.prepareGPIO(18);

After that you can set your GPIO to HIGH (turn on) anytime with:

gpioexport.set(18);

Or you can set your GPIO to LOW (turn off) anytime with:

gpioexport.unset(18);

The library only supports GPIOs as output. But in the fastest possible way from node.js. It uses the standard Raspberry Pi GPIO numbers.