Introduce
Use node.js to control gpio on cubieboard
Install
npm install node-cubieboard-gpio
Usage
// Require library var GPIO = ; // initialize the gpio pin var pin = GPIOPD0; var status = 0; GPIO; // config the gpio pin -> either input or output GPIO; // toggle a pin on and off var { ifstatus GPIO; status = 0; else GPIO; status = 1; } ;
Methods
/** initializes a pin to be used as a gpio args: none **/ GPIO /** reads a pins input args: Pin - pin instance that will become the input **/ GPIOinput /** writes a pin output args: Pin - pin instance that will become the input State - pin state. Either GPIO.LOW or GPIO.HIGH **/ GPIO /** sets the configuration of the pin as an input or an output args: Pin - pin instance that will become the input Direction - direction of the pin. Either GPIO.OUT or GPIO.IN **/ GPIO /** gets the configuration parameters of the pin args: none **/ GPIO