Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Gpio = require('rpio2').Gpio;
- const fs = require('fs');
- var gs = Gpio.createReadStream(32, {throttle: 100});
- gs.pipe(fs.createWriteStream("result.json"));
- var gpio = new Gpio(32);
- gpio.open(Gpio.INPUT);
- gpio.on('falling', function()
- {
- console.log("PIN HIGH");
- });
- console.log(gs.read());
- process.on("SIGINT", function(){
- gs.end();
- process.exit(0);
- });
- var r = Math.random() * (23 - 21) + 21;
- console.log(r);
- //PiMotion = require('node-pi-motion');
- //var options = {
- // verbose: true,
- //throttle: 200
- //}
- //var nodePiMotion = new PiMotion(options);
- //nodePiMotion.on('DetectedMotion', function() {
- // console.log('Motion detected! Now do something.');
- //});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement