Skip to content

board.reportDigitalPin(digitalPinNumber, 0) has no effect #185

@pichlermi

Description

@pichlermi

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions