Miss any of our Open RFC calls?Watch the recordings here! »

js-seeed-studio-relay-board

1.0.0 • Public • Published

js-seeed-studio-relay-board

This is a node.js package that can control and get state of the Seeed Studio Raspberry Pi Relay Board v.1.0. Inspired by the Python library for the Seeed Studio Relay Board.

Getting Started

Install :

npm install js-seeed-studio-relay-board

Usage

const SeeedStudioRelayBoard = require('js-seeed-studio-relay-board')
 
async function main() {
    const rpi = new SeeedStudioRelayBoard.Relay()
 
    // Initialize I2C controler
    await rpi.init()
 
    /**
     * Examples
     **/
 
    // Turn relay 3 ON.
    await rpi.on(3)
 
    // Get status of relay 3.
    await rpi.get(3)
 
    // Get status of all relays.
    await rpi.getAll()
 
    // Turn relay OFF.
    await rpi.off(3)
 
    // Turn all relays OFF.
    await rpi.allOff()
}

Contributing

If you wanna fix something feel free to open a issue or a PR.

Install

npm i js-seeed-studio-relay-board

DownloadsWeekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

6.06 kB

Total Files

4

Last publish

Collaborators

  • avatar