Motors Challenge
Hardware
- Metro ESP32-S2 MCU
- Grove Board
- Motor Shield
- Motors
- Sensors: Grove Button, Potentiometer
Fix Speed
- Write a program that makes both motors rotate at a fixed speed: 180.
- When the button is pressed: both motors stop.
- Motors restart when the button is pressed again
Variable Speed forward and backward
Write a program that makes both motors rotate at a speed that is defined by the potentiometer. Motors rotate in opposite directions. When the button is pressed, both motors stop then immediately start rotating in the opposite directions. This can be repreated several times.
- Initially, motor A rotates forward, while motor B rotates backward
- After 1 button press: motor A rotates backward and motor B rotates foward
- After 2 button presses, we are back to to the initial condition: motor A rotates forward and motor B rotates forward