๐ Wiring
Connect the motor driver: o3/o4 = right motor, o5/o6 = left motor.
Tell the board which pins are motors in setup. Then robot_control(left, speed, right, speed) drives: "F" forward, "B" backward, "S" stop.
import motor setup: o3 = set_function(motor_right_forward) o4 = set_function(motor_right_backward) o5 = set_function(motor_left_forward) o6 = set_function(motor_left_backward) loop: robot_control("F", 80, "F", 80) wait(1000) robot_control("B", 80, "F", 80) wait(500)
๐ก Tip
Left wheel backward + right wheel forward = spin left on the spot.
๐ Your turn
Make the robot drive in a big circle: both forward, but one wheel slower.