def main(): root = tkinter.Tk() frame = ttk.Frame(root, padding=10) frame.grid() row = 1 column = 1 port = '/dev/cu.usbserial-AL00EWSO' port = '/dev/cu.usbserial-A012KMUK' port = '/dev/cu.usbserial-A9048HVI' port = '/dev/cu.usbserial-A9048HVD' # R12 port = '/dev/cu.usbserial-A9048HV2' # R15 robot = rb.RoseBot() function = lambda: connect(robot, port) make_button(frame, 'Connect', function, row, column) row += 1 make_movement_buttons(frame, robot, row) row += 1 make_sensor_buttons(frame, robot, row) row += 1 make_button(frame, 'Blink', lambda: blink(robot), row, column) column += 1 make_button(frame, 'Play tones', lambda: play_tones(robot), row, column) root.mainloop()
def __init__(self): """ Initializes instance variables (fields). """ # Add self.FOO = BLAH here as needed. # Choose meaningful names! self.demo = 'demo' self.robot = rb.RoseBot() self.time_cliked = 0
def __init__(self): """ Initializes instance variables (fields). """ # Add self.FOO = BLAH here as needed. # Choose meaningful names! self.robot = rb.RoseBot() self.robot.is_stopped = False
def __init__(self): """ Initializes instance variables (fields). """ # Add self.FOO = BLAH here as needed. # Choose meaningful names! self.robot = rb.RoseBot() self.robot.motor_controller.left_motor_pwm = 0 self.robot.motor_controller.right_motor_pwm = 0 self.stop = False
def main(): test() return robot = rb.RoseBot() root = tkinter.Tk() frame0 = ttk.Frame(root) frame0.grid() sim = Simulator(robot, root, frame0) sim.run() root.mainloop()
def main(): root = tkinter.Tk() robot = rb.RoseBot() frame = ttk.Frame(root, padding=10) frame.grid() connection_gui(frame, robot, DEFAULT_PORT) blink_tone_gui(frame, robot) movement_gui(frame, robot) sensor_gui(frame, robot) pixy_gui(frame, robot) root.mainloop()
def main(): root = tkinter.Tk() robot = rb.RoseBot() frame = ttk.Frame(root, padding=10) frame.grid() connection_gui(frame, robot) blink_tone_gui(frame, robot) movement_gui(frame, robot) sensor_gui(frame, robot) pixy_gui(frame, robot) # sensor_with_movement_gui( # make_subframe(frame, 'For testing sensors with movment'), robot) # communication_gui(frame, robot) root.mainloop()
def setUpClass(self): self.port = '/dev/cu.usbserial-AL00EWSO' # R08 self.port = '/dev/cu.usbserial-A9048HUT' self.port = '/dev/cu.usbserial-AI02KMUK' # R01 self.port = '/dev/cu.usbserial-AL00F14M' # R32? self.port = '/dev/cu.usbserial-A9048HVD' # R12 self.port = '/dev/cu.usbserial-AL00EWSL' # R02 self.port = '/dev/cu.usbserial-A9048HV2' # R15 or R32 self.port = '/dev/cu.usbserial-A9048HV2' # R32 or R15 self.port = '/dev/cu.usbserial-AL00EXQL' # R07 self.port = '/dev/cu.usbserial-A9048HV2' # no wifly self.port = '/dev/cu.usbserial-A9048HVD' # R12 self.port = '/dev/cu.usbserial-A9048HV7' # R25 self.port = 'r22' self.port = '/dev/cu.usbserial-A9048GN8' # R25 # self.port = 'r07' self.robot = rb.RoseBot() self.robot.connector.connect_wired(self.port)
def main(): COM_PORT = 5 # REPLACE WITH YOUR COM PORT OR ROBOT NUMBER!! WIRED = True # Set to False if you would like to use wireless connection "Connect to robot" robot = rb.RoseBot() if WIRED: robot.connector.connect_wired(COM_PORT) else: robot.connector.connect_wireless(COM_PORT) # print (robot.sensor_reader.button_sensor.is_pressed()) root = tkinter.Tk() frame = ttk.Frame(root) frame.grid() "Show sensor values" sensors = ttk.Button(frame, text="print sensors") sensors['command'] = (lambda: sensor_display(robot)) sensors.grid() "Activate motors" motor = ttk.Button(frame, text="run motors") motor['command'] = (lambda: motors(robot)) motor.grid() "Blink LED" led = ttk.Button(frame, text="flash led") led['command'] = (lambda: blink(robot)) led.grid() "Sing" song = ttk.Button(frame, text="sing song") song['command'] = (lambda: sing(robot)) song.grid() "Disconnect" disconnect = ttk.Button(frame, text='disconnect') disconnect['command'] = (lambda: robot.connector.disconnect()) disconnect.grid() root.mainloop()