Wondering what’s next for npm?Check out our public roadmap! »

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

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

Web GPIO API

Install

npm i node-web-gpio

DownloadsWeekly Downloads

19

Version

1.0.1

License

MIT

Unpacked Size

9.61 kB

Total Files

5

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar