diff --git a/tests/gpio.js b/tests/gpio.js new file mode 100644 index 0000000..e87745c --- /dev/null +++ b/tests/gpio.js @@ -0,0 +1,13 @@ +'use strict' + +const Gpio = require('onoff').Gpio + +const btn = Gpio(18, 'in', 'both') + +console.log('Watching input on button 18') +btn.watch((err, val) => { + if (err) { + return console.error(err) + } + console.log(val) +}) \ No newline at end of file