Measuring Movement with Encoders on Raspberry Pi Pico
Robots don’t just run code blindly; they need sensors. What sensors do we add first? Our robot already has some sensors on board, and in this chapter, we’ll see how to use them.
We finished the previous chapter noticing that timing isn’t the most accurate way to determine robot movement. So, let’s see how our first sensor, encoders, can improve this. Encoders are the first step in getting accurate movement and location estimation in robots. We will also learn one of Raspberry Pi Pico’s excellent features – Programmable IO (PIO).
We’ll dig into movement fundamentals, odometry and encoding, look at Raspberry Pi Pico PIO in CircuitPython, and use this to get data from the encoders on our robot.
In this chapter, we’re going to cover the following main topics:
- About encoders and odometry
- Wiring in encoders on a Raspberry Pi Pico robot
- Programming Raspberry...