Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/muffag/rpi-gpio-sysfs
Access GPIO pins on Raspberry Pi via sysfs
https://github.com/muffag/rpi-gpio-sysfs
gpio raspberry-pi sysfs
Last synced: about 1 month ago
JSON representation
Access GPIO pins on Raspberry Pi via sysfs
- Host: GitHub
- URL: https://github.com/muffag/rpi-gpio-sysfs
- Owner: muffag
- Created: 2018-02-08T10:49:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-07T09:04:38.000Z (almost 5 years ago)
- Last Synced: 2025-01-10T17:53:15.313Z (about 1 month ago)
- Topics: gpio, raspberry-pi, sysfs
- Language: TypeScript
- Homepage:
- Size: 25.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rpi-gpio-sysfs
Basic access to GPIO pins via [sysfs](https://elinux.org/RPi_GPIO_Code_Samples#sysfs.2C_part_of_the_raspbian_operating_system) 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
```typescript
import { createPin } from 'rpi-gpio-sysfs';const pin = await createPin(18, 'out');
await pin.write(true);
```### Read
```typescript
import { createPin } from 'rpi-gpio-sysfs';const pin = await createPin(18, 'in');
const status: boolean = await pin.read();
```