Appendix A1: Arduino Command Server
Why discuss the Arduino microcontroller in the context of a book about the Raspberry Pi? In robotics projects, it is common to off-load tasks from the Pi to an Arduino, achieving parallel processing. There are general benefits to parallel processing, but perhaps the most important benefit is that tasks can get much closer to “real-time” behavior running on an Arduino than running on a Pi. The Pi’s multitasking operating system has to allocate resources to your task and numerous system tasks. The Arduino has no OS and so devotes all resources to your task, and an Arduino task has very good control over the timing of actions.
In some cases, there is another good reason to leverage an Arduino. Due to the prevalence ...