UNPKG

pigpio

Version:

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

12 lines (7 loc) 234 B
'use strict'; const Gpio = require('../').Gpio; const button = new Gpio(4, {alert: true}); button.on('alert', (level, tick) => { console.log(level + ' ' + tick); }); console.log(' press the momentary push button a few times');