diff --git a/tests/gpio.js b/tests/gpio.js index e452b42..88d655a 100644 --- a/tests/gpio.js +++ b/tests/gpio.js @@ -2,12 +2,17 @@ const Gpio = require('onoff').Gpio -const btn = Gpio(12, 'in', 'both') +const btn = Gpio(18, 'in', 'both') console.log('Watching input on button 18') -btn.watch((err, val) => { + +/*btn.watch((err, val) => { if (err) { return console.error(err) } console.log(val) -}) \ No newline at end of file +})*/ + +setInterval(() => { + console.log(btn.readSync()) +}, 1000) \ No newline at end of file