Beagle Board - beagleboard.org

BoneScript

Not Connected
Did you know? This page can interact with your BeagleBone
Type in your BeagleBone's IP address here:

attachInterrupt(pin, handler, mode, [callback])

Detect changes on a digital input line

Note: This function is still undergoing development and debug.

Arguments

  • pin: the BeagleBone pin identifier
  • handler:
    • true: always call the callback upon interrupt event
    • string: evaluated upon interrupt, passed an object with 'value' having the state of the input pin and will call callback if evaluates to true
  • mode: RISING, FALLING or CHANGE
  • callback: called when handler returns true or other events

Return value

callback(x)

  • x.pin: pin that generated event
  • x.output: result of handler function
  • x.value: input state of the pin generating the interrupt
  • x.attached: handler successfully attached
  • x.configured: interrupt handler previously configured

Example

X

Build and execute instructions

  • Toggle the state of P8_19 within 12 seconds of starting script.

See also

Topics

Related functions

Examples


Last updated by blog.hangerhead.com on Fri Jun 21 2013 14:36:23 GMT-0000 (UTC).
20058