tinyvm.rcx
Class Button
java.lang.Object
|
+--tinyvm.rcx.Button
- public class Button
- extends Object
Abstraction for an RCX button.
Example:
Button.RUN.waitForPressAndRelease();
Sound.playTone (1000, 1);
VIEW
public static final Button VIEW
- The View button.
PRGM
public static final Button PRGM
- The Prgm button.
RUN
public static final Button RUN
- The Run button.
isPressed
public final boolean isPressed()
- Returns:
true
if button is pressed, false
otherwise.
waitForPressAndRelease
public final void waitForPressAndRelease()
- Loops until the button is released.
readButtons
public static int readButtons()
- Low-level API that reads status of buttons.
- Returns:
- An integer with possibly some bits set: 0x02 (view button pressed)
0x04 (prgm button pressed), 0x01 (run button pressed). If all buttons
are released, this method returns 0.