|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--stamp.core.Button
Push button with auto-repeat and repeat-delay.
| Field Summary | |
static int |
BUTTON_AUTO_REPEAT
The button is down and is auto-repeating. |
static int |
BUTTON_DEBOUNCE
The button has just gone down and we are waiting for the debounce period. |
static int |
BUTTON_DOWN
The button has just gone down. |
static int |
BUTTON_UP
The button is currently up. |
int |
debounceDelay
The amount of time to debounce when the button goes down. |
static int |
DEFAULT_REPEAT_DELAY
|
static int |
DEFAULT_REPEAT_RATE
|
int |
repeatDelay
Delay in milliseconds before repeat starts. |
int |
repeatRate
Delay in milliseconds between each repetition. |
| Constructor Summary | |
Button(int portPin,
boolean upState)
Create an instance of the Button class without auto-repeat. |
|
Button(int portPin,
boolean upState,
int repeatDelay,
int repeatRate)
Create an instance of the Button class with auto-repeat enabled. |
|
| Method Summary | |
boolean |
buttonDown()
Check whether the button is down. |
int |
getState()
Returns the current state of the button. |
| Methods inherited from class java.lang.Object |
equals |
| Field Detail |
public int repeatDelay
public int repeatRate
public int debounceDelay
public static final int DEFAULT_REPEAT_DELAY
public static final int DEFAULT_REPEAT_RATE
public static final int BUTTON_UP
public static final int BUTTON_DOWN
public static final int BUTTON_AUTO_REPEAT
public static final int BUTTON_DEBOUNCE
| Constructor Detail |
public Button(int portPin,
boolean upState,
int repeatDelay,
int repeatRate)
portPin - the pin that the button is connected to.upState - the state of the pin when the button is up.repeatDelay - the delay in milliseconds after the button has gone down
and before it should start repeating.repeatRate - the time in milliseconds before each repeated button
down event.
public Button(int portPin,
boolean upState)
portPin - the pin that the button is connected to.upState - the state of the pin when the button is up.| Method Detail |
public boolean buttonDown()
public int getState()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||