Further reading
These further study aids will help you learn more and dive deeper into using encoders to control robot motion:
- In Learn Robotics Programming Second Edition, Chapter 11, Programming Encoders with Python, I used simpler encoders but dove into the calculations needed to make specific turns with encoders that could be adapted to the Pico.
- The Arduino-based tutorial at https://circuitdigest.com/microcontroller-projects/arduino-based-encoder-motor-using-pid-controller shows how to use a PID controller.
- This Python file at https://github.com/pimoroni/pimoroni-pico/blob/main/micropython/examples/inventor2040w/motors/position_control.py from Pimoroni shows a similar Python approach in MicroPython for the Pico.