-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Description
From the Documentation:
To stop reporting digital values for a pin, call board.reportDigitalPin(digitalPinNumber, 0). To restart, call digitalRead(pin,callback) or use board.reportDigitalPin(digitalPinNumber, 1) if you don't want to call digitalRead again. <<
Reproduce the Error:
board.pinMode( 2, board.MODES.INPUT );
board.digitalRead(2, function(value) {
console.log("The value of digital pin 2 changed to: " + value);
});
board.reportDigitalPin(2, 0);
The log message is still written to the console, when Pin 2 is toggled.
Hack:
board.pinMode( 2, board.MODES.INPUT );
cb = function(value) {
console.log("The value of digital pin 2 changed to: " + value);
}
board.digitalRead(2, cb);
board.removeListener( "digital-read-2", cb )
Now, no message is written.
Metadata
Metadata
Assignees
Labels
No labels