def go_inches(inches, percent_of_max_speed): """ Makes the EV3 Robot move the given number of inches at the given speed. :type inches: float :type percent_of_max_speed: float -100 to 100 """ # TODO: 5. Implement and test this function. left_motor = rb.LargeMotor(rb.Plug("B")) right_motor = rb.LargeMotor(rb.Plug('c')) left_motor.start(percent_of_max_speed) right_motor.start(percent_of_max_speed) time.
def go_inches(inches, percent_of_max_speed): """ Makes the EV3 Robot move the given number of inches at the given speed. :type inches: float :type percent_of_max_speed: float -100 to 100 """ # TODO: 5. Implement and test this function. left_motor = rb.LargeMotor(rb.Plug("B")) # Constructs Motor for left wheel right_motor = rb.LargeMotor(rb.Plug("A")) left_motor.start() right_motor.start() time.sleep(2) left_motor.brake()
def go_two_seconds(): # ------------------------------------------------------------------------- # TODO: 3. # Make the robot move, by using this pattern: # - Turn on (start) the wheel motors. # - time.sleep(2) # Pause here, let other processes run for 2 seconds # - Turn off (brake or coast) the wheel motors. # # Use the DOT trick to figure out how to start, brake and coast motors. # ------------------------------------------------------------------------- left_motor = rb.LargeMotor(rb.Plug("B")) # Constructs Motor for left wheel right_motor = rb.LargeMotor(rb.Plug("C")) left_motor.start(), right_motor.start() time.sleep(4) left_motor.brake(), right_motor.brake()