You might be able to see a newer version of this on beagleboard.org/support/bonescript/digitalRead

digitalRead(pin, [callback])

Read the status of a digital I/O pin.

Arguments

Return value

callback(x)

Example

var b = require('bonescript');
b.pinMode('P8_19', b.INPUT);
b.digitalRead('P8_19', printStatus);
function printStatus(x) {
    console.log('x.value = ' + x.value);
    console.log('x.err = ' + x.err);
}

Build and execute instructions

See also

Topics

Related functions

Examples