Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.
/ node-lot-gpio Public archive

lot-gpio - GPIO development library for Node.js

License

Notifications You must be signed in to change notification settings

hhk7734/node-lot-gpio

Repository files navigation

license node language

node-lot-gpio

Installation

Ref: https://github.com/loliot/lot

sudo add-apt-repository -y ppa:loliot/ppa \
&& sudo apt install lot
sudo lot install cpp
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - \
&& sudo apt-get install -y nodejs
mkdir project \
&& cd project \
&& npm init -y
npm install lot-gpio

Blink example

const lot = require("lot-gpio");

let pin = 13;

if (process.argv.length > 2) {
    pin = Number(process.argv[2]);
}

const led = new lot.Gpio(pin);
led.mode(lot.DOUT);

setInterval(() => {
    led.toggle();
}, 200);