|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectjBotBrain.hw.Button
public class Button
Abstraction for a button. Device is equipped with four buttons:
S1, S2, S3, S4 (as you can see on PCB).
Example of usage:
Button.S2.waitForPress();
Button.S4.isPressed();
int s1Id = Button.BUTTONS[0].getId();
| Field Summary | |
|---|---|
static Button[] |
BUTTONS
Array containing S1, S2, S3, S4, in that order. |
static Button |
S1
The S1 button. |
static int |
S1_BUTTON
The S1 button value. |
static Button |
S2
The S2 button. |
static int |
S2_BUTTON
The S2 button value. |
static Button |
S3
The S3 button. |
static int |
S3_BUTTON
The S3 button value. |
static Button |
S4
The S4 button. |
static int |
S4_BUTTON
The S4 button value. |
| Method Summary | |
|---|---|
int |
getId()
Return the ID of the button. |
boolean |
isPressed()
Check if the button is pressed. |
static int |
readButtons()
Low-level API that reads status of buttons. |
static int |
waitForPress()
wait for some button to be pressed |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait |
| Field Detail |
|---|
public static final int S4_BUTTON
public static final int S3_BUTTON
public static final int S2_BUTTON
public static final int S1_BUTTON
public static final Button S1
public static final Button S2
public static final Button S3
public static final Button S4
public static final Button[] BUTTONS
| Method Detail |
|---|
public final int getId()
S1_BUTTON,
S2_BUTTON,
S3_BUTTON,
S4_BUTTONpublic final boolean isPressed()
true if button is pressed, false otherwise.public static int waitForPress()
S1_BUTTON,
S2_BUTTON,
S3_BUTTON,
S4_BUTTONpublic static int readButtons()
S1_BUTTON,
S2_BUTTON,
S3_BUTTON,
S4_BUTTON
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||