While working on the next release of PixelMaestro, I came across a problem of storing long-term data on an Arduino. I have a system in place where configuration changes are sent to an Arduino over USB as byte arrays, and as the Arduino reads the array it applies the changes. The problem is those changes disappear as soon as you restart the device. How, then, does one store persistent data without having to add an SD card or extra memory? Enter EEPROM.
On today’s episode of “Adventures in C++”: sending commands between two Arduinos running the same software. Not just data, but also instructions on how to process and execute that data. Even more, these commands have to be small enough for each Arduino to package, send, receive, unpack, and execute in less than 1/10th of a second.
When I first started this blog, I was just dipping my toes back into the world of C++. Before that, my experience with it was mostly academic, and after struggling through a course with a particularly poor professor I swore off it in favor of VB.NET. No, I never did forgive myself for that decision, but it ultimately helped me learn to appreciate the importance and relevance of C++. And after tinkering with systems that use C++ exclusively, I’ve come to appreciate it even more.
A few months ago, I decided to buy an Arduino. For those who are unfamiliar, an Arduino is a small programmable computer typically used to power a specific application such as a smoke detector, medical device, watch, household appliance, or automobile engine. My reasons for buying an Arduino were twofold: I wanted to learn how small, embedded computers were being used to power our everyday lives, and I wanted to learn more about the Maker’s Movement. While this post focuses on the first reason, you can learn more about the Maker’s Movement through a variety of resources including Make Magazine and Wikipedia.