Controller input¶
Controller input is exposed through robot.controller. The data is cached and
read immediately; property access does not block for a new packet.
Controller¶
Students normally use the instance owned by Robot, rather than constructing a
Controller directly.
Attributes¶
button¶
Returns a cached button object. Names are converted to uppercase.
Raises ValueError when name is empty. The current API does not validate
names against a fixed hardware list.
Joystick¶
Students normally obtain joysticks from Controller.
Properties¶
| Property | Type | Meaning | Default before data |
|---|---|---|---|
x |
float |
Scaled X axis, intended range −100 to 100 | 0.0 |
y |
float |
Scaled Y axis, intended range −100 to 100 | 0.0 |
raw_x |
int |
Raw 12-bit ADC X | 2048 |
raw_y |
int |
Raw 12-bit ADC Y | 2048 |
Button¶
Students normally obtain buttons through Controller.button().
is_down: bool¶
True while the button is currently pressed. This is a level, not a press/release event.