Gamepad
Smart CarThe Game Pad in the MoBot app on your phone, received over Bluetooth.
How you reach it
Section titled “How you reach it”The Gamepad class is reached through this attribute of robot.
robot.gamepad
Section titled “robot.gamepad”Always there.
All the attributes of robot are in its table.
Properties
Section titled “Properties”How far the stick is pushed: -128 (left) to 127 (right), 0 in the middle.
x: intRead only.
Used in examples: Name your robot, then drive it
How far the stick is pushed: -128 (down) to 127 (up), 0 in the middle.
y: intRead only.
Used in examples: Name your robot, then drive it
Methods
Section titled “Methods”is_pressed(name)
Section titled “is_pressed(name)”True while that button is held: "a", "b", "x", "y", "up", "down", "left" or "right".
is_pressed(name) -> boolUsed in examples: Name your robot, then drive it
buttons()
Section titled “buttons()”Every button at once, as a dict of name -> True while it is held.
buttons() -> Dict[str, bool]