def draw(x, tolerance=0.05): if isinstance(x, drawing.Drawing): x = x.paths device = Device() time.sleep(2) device.pen_up() time.sleep(1) device.home() bar = progress.Bar() for path in bar(x): if tolerance: path = simplify(path, tolerance) device.draw(path)
print resp break # Initialize x and y variables x = 0 y = 0 delay = 1 # in seconds # Connect and Initialize print('Connecting...') d = Device() sleep(2) print('Connected, returning home.') d.pen_up() d.home() reportPos() # Calibrate X print('Calibrating X...') moveX = True try: while moveX: x = x + 5 d.move(x, y) sleep(delay) reportPos() except KeyboardInterrupt: moveX = False reportPos() print('X Calibrated!')