gpio-omega2
v1.0.0
Published
Control Onion Omega2 GPIO pins from NodeJS using fast-gpio
Downloads
7
Readme
GPIO Omega2
Control Onion Omega2 GPIO pins from NodeJS using fast-gpio.
Quick start
Add this module to your project
npm install --save gpio-omega2
Usage
Control a Pin
'use strict';
const GpioOmega2 = require('gpio-omega2');
const gpio = new GpioOmega2();
const pinNumber = 0;
const pin = gpio.pin({pin: pinNumber, mode: 'output'});
pin.high();
Turn on a led
'use strict';
const GpioOmega2 = require('gpio-omega2');
const gpio = new GpioOmega2();
const pinNumber = 0;
const led = gpio.led(pinNumber);
led.on();
Blinking led
'use strict';
const GpioOmega2 = require('gpio-omega2');
const gpio = new GpioOmega2();
const pinNumber = 0;
const led = gpio.led(pinNumber);
const delay = 500;
led.blink(delay);
Functions
- pin.high();
- pin.low();
- pin.toggle();
- pin.set(value);
- led.on();
- led.off();
- led.toggle();
- led.blink();
- led.stopBlinking();
Authors
- Felipe Céspedes - [email protected] - felipecespedes
License
This project is licensed under the MIT License - see the LICENSE file for details