@iiot2k/gpio

2.0.4 • Public • Published

@iiot2k/gpio

Raspberry Pi GPIO library.

Installation

npm install @iiot2k/gpio

Detail

  • This library works on Raspberry Pi with 32bit or 64bit OS.
  • Works also on Raspberry Pi 5.

Functions

  • Read/Write/Toggle GPIO.
  • Watch GPIO.
  • PWM Output.
  • High Speed Counter.
  • Reads Temperature from Sensors (DS18B20).

API

All API functions are explained in dokument API.md and API.pdf

Example

// 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.

Package Sidebar

Install

npm i @iiot2k/gpio

Weekly Downloads

14

Version

2.0.4

License

Apache-2.0

Unpacked Size

392 kB

Total Files

17

Last publish

Collaborators

  • iiot2k