Planning components and code structure
You've now briefly seen some components you might use in a robot, and you've encountered a block diagram to put them together. This is where you may start taking the next step and thinking further about how to connect things, and how the code you write for them will be structured.
Code is easier to reason about when taken as logical blocks instead of one large lump. Arranging code in ways that are similar to a hardware functionality diagram will help navigate your way around as it becomes more complicated.
So, let's return to the robot block diagram in Figure 2.3 to think about what we'll need to handle in our code for it. That diagram has three sensors and two outputs. Each component (sensor, output, and controller board) may need some code to deal with it, and then you need some code for the behavior of combined modules.
Motor controllers come in many flavors. They have different ways to output to motors, and they...