node.js - how to read from a GPIO pin when it changes? -


I create an app that lights (LEDs) their position (on-> off or off->) Monitor on a site. I node this app in client side Build with JS and use it from the rpi.GPIO package.
But I change event is my code in this package:

  var gpio = require ('rpi-gpio'); Function Alert () {console.log ("Search!"); } Gpio.on ('change', function (channel, value) {// send monitoring data to server for monitor on site});); Gpio.setup (7, gpio.DIR_IN, warning);  

Changes never called the event !! Even if I change the position of the LED. Is setInterval ?

What is a way to do this without using it? Not sure why this is not working, but you can also consider the package.


Comments

Popular posts from this blog

c++ - C/pp Sockets, recv()/send() works only under gdb -

GO: Serve static pages -

objective c - How to open front/back camera at the same time in iOS developing? -