rpi-gpio-sysfs
v1.0.1
Published
Access to Raspberry Pi's GPIO pins via sysfs
Downloads
4
Readme
rpi-gpio-sysfs
Basic access to GPIO pins via sysfs in Node.js. This package has native TypeScript support and uses a Promise-based API.
The library has been tested to work with the Compute Module 3, other Raspberry Pi's should work but will not be officially supported.
Installation
npm install rpi-gpio-sysfs
Usage
Write
import { createPin } from 'rpi-gpio-sysfs';
const pin = await createPin(18, 'out');
await pin.write(true);
Read
import { createPin } from 'rpi-gpio-sysfs';
const pin = createPin(18, 'in');
const status: boolean = await pin.read();