Add gpio.js test file

This commit is contained in:
mmcwilliams 2017-09-16 14:47:33 -04:00
parent 32625bbbde
commit 996e0ca81a
1 changed files with 13 additions and 0 deletions

13
tests/gpio.js Normal file
View File

@ -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)
})