GPIO access with Node.js
Find a file
2019-10-13 02:13:19 +09:00
.gitignore create @notweb/gpio 2019-10-13 02:13:19 +09:00
index.d.ts create @notweb/gpio 2019-10-13 02:13:19 +09:00
index.js create @notweb/gpio 2019-10-13 02:13:19 +09:00
index.ts create @notweb/gpio 2019-10-13 02:13:19 +09:00
LICENSE create @notweb/gpio 2019-10-13 02:13:19 +09:00
package.json create @notweb/gpio 2019-10-13 02:13:19 +09:00
README.md create @notweb/gpio 2019-10-13 02:13:19 +09:00
tsconfig.json create @notweb/gpio 2019-10-13 02:13:19 +09:00
yarn.lock create @notweb/gpio 2019-10-13 02:13:19 +09:00

@notweb/gpio

GPIO access with Node.js

Usage

const { requestGPIOAccess } = require("@notweb/gpio");

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

  await port.export("out");

  for (;;) {
    port.write(value);
    await new Promise(resolve => setTimeout(resolve, 1e3));
  }
}

main();

Document

Web GPIO API