class TestGoStraight(SyncedSketch): def setup(self): left = Motor(self.tamp, 5, 4) right = Motor(self.tamp, 2, 3) gyro = Gyro(self.tamp, 10, integrate=True) self.movement = GoStraight(left, right, Timer()) self.timer = Timer() def loop(self): if self.timer.millis() > 100: self.timer.reset() # Intended behavior: Have the robot turn in a circle. # move_to_target() was not defined self.movement.move_to_target(45, 50)
def setup(self): left = Motor(self.tamp, 5, 4) right = Motor(self.tamp, 2, 3) gyro = Gyro(self.tamp, 10, integrate=True) self.movement = GoStraight(left, right, Timer()) self.timer = Timer()