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);
 


Field Summary
static Button PRGM
          The Prgm button.
static Button RUN
          The Run button.
static Button VIEW
          The View button.
 
Method Summary
 boolean isPressed()
           
static int readButtons()
          Low-level API that reads status of buttons.
 void waitForPressAndRelease()
          Loops until the button is released.
 
Methods inherited from class java.lang.Object
getClass, toString
 

Field Detail

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.
Method Detail

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.