rwaldron / galileo-io

Intel Galileo & Intel Edison IO Plugin for Johnny-Five
http://johnny-five.io
MIT License
101 stars 26 forks source link

Quick Question - How do I stop digitalRead()? #9

Closed janunezc closed 10 years ago

janunezc commented 10 years ago

In the Readme file it states that digitalRead and analogRead functions work by setting up some sort of callback event handler that is constantly called for reading an specific GPIO pin.

I would like to stop the reading after, say 100 samples...

Is that possible?

rwaldron commented 10 years ago

This is the undocumented way:

board.removeAllListeners("digital-read-#");

Where # is the pin number.