dist/webduino-all.js
function Button(board, pin, buttonMode, sustainedPressInterval) {
    Module.call(this);

    this._board = board;
    this._pin = pin;
    this._repeatCount = 0;
    this._timer = null;
    this._timeout = null;

    this._buttonMode = buttonMode || Button.PULL_DOWN;
    this._sustainedPressInterval = sustainedPressInterval || 1000;
    this._debounceInterval = 20;
    this._pressHandler = onPress.bind(this);
    this._releaseHandler = onRelease.bind(this);
    this._sustainedPressHandler = onSustainedPress.bind(this);

    board.setDigitalPinMode(pin.number, Pin.DIN);

    if (this._buttonMode === Button.INTERNAL_PULL_UP) {
      board.enablePullUp(pin.number);
      this._pin.value = Pin.HIGH;
    } else if (this._buttonMode === Button.PULL_UP) {
      this._pin.value = Pin.HIGH;
    }

    this._pin.on(PinEvent.CHANGE, onPinChange.bind(this));
  }
function Button(board, pin, buttonMode, sustainedPressInterval) {
    Module.call(this);

    this._board = board;
    this._pin = pin;
    this._repeatCount = 0;
    this._timer = null;
    this._timeout = null;

    this._buttonMode = buttonMode || Button.PULL_DOWN;
    this._sustainedPressInterval = sustainedPressInterval || 1000;
    this._debounceInterval = 20;
    this._pressHandler = onPress.bind(this);
    this._releaseHandler = onRelease.bind(this);
    this._sustainedPressHandler = onSustainedPress.bind(this);

    board.setDigitalPinMode(pin.number, Pin.DIN);

    if (this._buttonMode === Button.INTERNAL_PULL_UP) {
      board.enablePullUp(pin.number);
      this._pin.value = Pin.HIGH;
    } else if (this._buttonMode === Button.PULL_UP) {
      this._pin.value = Pin.HIGH;
    }

    this._pin.on(PinEvent.CHANGE, onPinChange.bind(this));
  }
function Button ( board , pin , buttonMode , sustainedPressInterval ) { Module . call ( this ) ; this . _board = board ; this . _pin = pin ; this . _repeatCount = 0 ; this . _timer = null ; this . _timeout = null ; this . _buttonMode = buttonMode || Button . PULL_DOWN ; this . _sustainedPressInterval = sustainedPressInterval || 1000 ; this . _debounceInterval = 20 ; this . _pressHandler = onPress . bind ( this ) ; this . _releaseHandler = onRelease . bind ( this ) ; this . _sustainedPressHandler = onSustainedPress . bind ( this ) ; board . setDigitalPinMode ( pin . number , Pin . DIN ) ; if ( this . _buttonMode === Button . INTERNAL_PULL_UP ) { board . enablePullUp ( pin . number ) ; this . _pin . value = Pin . HIGH ; } else if ( this . _buttonMode === Button . PULL_UP ) { this . _pin . value = Pin . HIGH ; } this . _pin . on ( PinEvent . CHANGE , onPinChange . bind ( this ) ) ; }
The Button Class.

@namespace webduino.module
@class Button
@constructor
@param {webduino.Board} board The board the button is attached to.
@param {webduino.pin} pin The pin the button is connected to.
@param {Number} [buttonMode] Type of resistor the button is connected to, either Button.PULL_DOWN or Button.PULL_UP.
@param {Number} [sustainedPressInterval] A period of time when the button is pressed and hold for that long, it would be considered a "sustained press." Measured in ms.
@extends webduino.Module
The Button Class .