Socket
Book a DemoInstallSign in
Socket

js-seeed-studio-relay-board

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-seeed-studio-relay-board

Javascript package to control the Seeed-Studio-Relay-Board.

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

raspberry-pi

FAQs

Package last updated on 09 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.