Guest User

Untitled

a guest
Jun 22nd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. var gpio = require('onoff').Gpio;
  2. var pir = new gpio(12, 'in', 'both');
  3. pir.watch(function(err, value) {
  4. if (value == 1) {
  5. console.log('Intruder alert');
  6. } else {
  7. console.log('Intruder gone');
  8. }});
Add Comment
Please, Sign In to add comment