Gamepad
MiniThe 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.
How far the stick is pushed: -128 (down) to 127 (up), 0 in the middle.
y: intRead only.
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) -> boolbuttons()
Section titled “buttons()”Every button at once, as a dict of name -> True while it is held.
buttons() -> Dict[str, bool]