GPIO.js - For now, a simple wrapper
This is a stupid module for controlling the GPIO ports on the Raspberry Pi. It just spawns a new new process in order to communicate with gpio. I'll eventually make a c module that will do better. I couldn't get the other node modules to work, so I made this simple wrapper. Sorry it is so dumb.
Requires wiringpi
npm install gpiojs
Note: Since this requires wiringpi, if you use this, please follow wiringpi's gpio scheme
API
To use, include:
var gpio = ;
gpio.set( port, value, callback )
Sets a GPIO port value. Example:
gpio;
gpio.label( name, port )
Alias a GPIO ports
gpiolabel 'led-1' 1 ;gpio;
gpio.setMode( port, mode, callback )
Sets a GPIO port mode. If you want to send a signal out, then set your port to out. Example:
gpio;
gpio.readAll( callback )
Get the current GPIO configuration. Equivalent to gpio readall
. Sends an array of objects to the second argument of the callback. The index of the array corresponds to the GPIO port. Example:
gpio;