ukcrobots.simplecore
Class Button
java.lang.Object
|
+--ukcrobots.simplecore.Button
- public class Button
- extends Object
Model a button on the RCX.
Implementation based on josx.platform.rcx.Button.
- Version:
- 2003.03.04
- Author:
- David J. Barnes (d.j.barnes @at@ kent.ac.uk)
NUM_BUTTONS
public static final int NUM_BUTTONS
- See Also:
- Constant Field Values
RUN
public static final int RUN
- See Also:
- Constant Field Values
VIEW
public static final int VIEW
- See Also:
- Constant Field Values
PRGM
public static final int PRGM
- See Also:
- Constant Field Values
BUTTONS
public static final Button[] BUTTONS
- Array containing VIEW, PRGM and RUN, in that order.
getButton
public static Button getButton(int id)
throws NoSuchDeviceException
- Parameters:
id
- A value of Button.RUN, Button.VIEW or Button.PRGM.
- Returns:
- The requested button
NoSuchDeviceException
isActive
public boolean isActive()
- A Button is always active.
- Returns:
- true
isPressed
public final boolean isPressed()
- Returns:
- true if the button is pressed, false otherwise.