def main_test(): toio = Toio(_get_ta_addr()) if toio.is_connected(): toio.back() toio.disconnect()
def main_steps(): toio = Toio(_get_ta_addr()) if toio.is_connected(): toio.straight() toio.turn_right() toio.back() toio.spin_turn_180() toio.disconnect()
def main_user_input(): toio = Toio(_get_ta_addr()) if toio.is_connected(): print("w: UP, a: TURN LEFT, d: TURN RIGHT, x: BACK, SHIFT+C: exit") while True: with ReadChar() as rc: char = rc if char == 'w': toio.straight() elif char == 'a': toio.turn_left() elif char == 'd': toio.turn_right() elif char == 'x': toio.back() if char in "^C": break toio.disconnect()
def main(): toio = Toio(_get_ta_addr()) if toio.is_connected(): toio.request_data(UUID_NAME) toio.straight() toio.disconnect()