Skip to content

Control Onion Omega2 GPIO pins from NodeJS using fast-gpio

License

Notifications You must be signed in to change notification settings

felipecespedes/gpio-omega2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Control Onion Omega2 GPIO pins from NodeJS using fast-gpio

Resources

License

Stars

Watchers

Forks

Packages

No packages published