Skip to content

Search the documentation

Kit
Firmware

Joystick

Smart Car

Reads how far the stick is pushed, left to right (x()) and forward to back (y()).

The Joystick class is reached through these attributes of robot.

Can be None until you call robot.enable_joysticks().

Can be None until you call robot.enable_joysticks().

All the attributes of robot are in its table. Read Attributes that can be None to see when a part is None.

How far the stick is pushed left to right, from 0 to 1023 (about 512 in the middle).

x() -> int

Used in examples: Servo arm and joystick

How far the stick is pushed forward to back, from 0 to 1023 (about 512 in the middle).

y() -> int

Used in examples: Servo arm and joystick