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

1.0.33 • 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

Package Sidebar

Install

npm i node-web-gpio

Weekly Downloads

2

Version

1.0.33

License

MIT

Unpacked Size

15.4 kB

Total Files

5

Last publish

Collaborators

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