gpio-omega2

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i gpio-omega2

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

6.54 kB

Total Files

4

Last publish

Collaborators

  • viwell