In this recipe, you will learn how to control both the speed and the rotational direction of a specific DC motor. You will see that providing a positive or negative value to the throttle will let us control whether the motor will turn clockwise or counterclockwise. We can also provide fractional values to the throttle to control the power the motor is run at.
When you use DC motors to control wheels on a MicroPython-powered, computer-controlled vehicle, the techniques in this recipe will be very useful. They will let you speed the car up or slow it down. You can also use them to make the car go in reverse or come to a full stop.