node-web-gpio
TypeScript icon, indicating that this package has built-in type declarations

1.1.15 • Public • Published

node-web-gpio

GPIO access with Node.js

Usage

const { requestGPIOAccess } = require("node-web-gpio");
const { promisify } = require("util");
const sleep = promisify(setTimeout);

async function main() {
  const gpioAccess = await requestGPIOAccess();
  const port = gpioAccess.ports.get(26);

  await port.export("out");

  for (;;) {
    await port.write(1);
    await sleep(1000);
    await port.write(0);
    await sleep(1000);
  }
}

main();

Document

Reference

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i node-web-gpio

    Weekly Downloads

    157

    Version

    1.1.15

    License

    MIT

    Unpacked Size

    16.1 kB

    Total Files

    5

    Last publish

    Collaborators

    • kou029w
    • krunaru
    • sizuhiko
    • akihiko.kigure
    • saxallan
    • satakagi
    • dynamis
    • rasp753