Fork me on GitHub
beagleboard.org

BoneScript

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

getPinMode(pin, [callback])

Get the mode of a pin.

Arguments

Return value

  • mux: index of mux mode
  • options: array of mode names
  • slew: 'fast' or 'slow'
  • rx: 'enabled' or 'disabled'
  • pullup: 'diabled', 'pullup' or 'pulldown'
  • pin: key string for pin
  • name: pin name
  • err: error status message

callback(x)

  • x: return value

Example

var b = require('bonescript');
b.getPinMode("P8_13", printPinMux);
function printPinMux(x) {
    console.log('mux = ' + x.mux);
    console.log('pullup = ' + x.pullup);
    console.log('slew = ' + x.slew);
    if(x.options) 
        console.log('options = ' + 
            x.options.join(','));
    console.log('pin = ' + x.pin);
    console.log('name = ' + x.name);
    console.log('err = ' + x.err);
}

Build and execute instructions

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

See also

Topics

Related functions