From 996e0ca81a04240d074b12aeea71f2a789ff6d35 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Sat, 16 Sep 2017 14:47:33 -0400 Subject: [PATCH] Add gpio.js test file --- tests/gpio.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/gpio.js 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