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

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -