Joystick
Smart CarReads how far the stick is pushed, left to right (x()) and forward to back (y()).
How you reach it
Section titled “How you reach it”The Joystick class is reached through these attributes of robot.
robot.joystick1
Section titled “robot.joystick1”Can be None until you call robot.enable_joysticks().
robot.joystick2
Section titled “robot.joystick2”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.
Methods
Section titled “Methods”How far the stick is pushed left to right, from 0 to 1023 (about 512 in the middle).
x() -> intUsed 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() -> intUsed in examples: Servo arm and joystick