UNPKG

pigpio

Version:

Fast GPIO, PWM, servo control, state change notification, and interrupt handling on the Raspberry Pi

15 lines (10 loc) 233 B
'use strict'; const Gpio = require('../').Gpio; const led = new Gpio(17, {mode: Gpio.OUTPUT}); const iv = setInterval(() => { led.trigger(100, 1); }, 2); setTimeout(() => { led.digitalWrite(0); clearInterval(iv); }, 2000);