Raspberry Pi GPIO library.
npm install @iiot2k/gpio
- This library works on Raspberry Pi with 32bit or 64bit OS.
- Works also on Raspberry Pi 5.
- Read/Write/Toggle GPIO.
- Watch GPIO.
- PWM Output.
- High Speed Counter.
- Reads Temperature from Sensors (DS18B20).
All API functions are explained in dokument API.md and API.pdf
// example turns output pin 20 on and after 3000ms off
"use strict";
const gpio = require("@iiot2k/gpio");
gpio.init_gpio(20, gpio.GPIO_MODE_OUTPUT, 1);
setTimeout(() => {
gpio.set_gpio(20, 0);
gpio.deinit_gpio(20);
}, 3000);
Examples are on examples folder.