Beagle Board - beagleboard.org

Bonescript

pinMode(pin, direction, [mux], [pullup], [slew], [callback])

Note: This function doesn't work until BoneScript version 0.2.3

This function configures the mode of a digital I/O pin.

Arguments

  • pin: the BeagleBone pin identifier
  • direction: INPUT, INPUT_PULLUP (under development on 3.8 kernel) or OUTPUT
  • mux: index to mux mode (under development on 3.8 kernel)
  • pullup: 'pullup', 'pulldown' or 'disabled' (under development on 3.8 kernel)
  • slew: 'fast' or 'slow' (under development on 3.8 kernel)
  • callback: called upon completion

Return value

callback(x)

  • x.value: return value
  • x.err: error status message

Example

var b = require('bonescript');
b.pinMode("P8_13", b.OUTPUT, 7, 'pullup', 
 'fast', printStatus);
b.getPinMode("P8_13", printPinMux);
function printStatus(x) {
    console.log('value = ' + x.value);
    console.log('err = ' + x.err);
}
function printPinMux(x) {
    console.log('mux = ' + x.mux);
    console.log('pullup = ' + x.pullup);
    console.log('slew = ' + x.slew);
    console.log('options = ' + x.options.join(','));
    console.log('err = ' + x.err);
}

Build and execute instructions

  • Check out some of the other examples to see and verify pinMode functionality.

See also

Topics

Related functions


Last updated by jkridner on Mon Aug 19 2013 16:19:12 GMT-0000 (UTC).
791