This was a fun project. Having completed the physical frame for my LED array and adding a light diffusing plastic cover, I set out to create fun animation to showcase my handiwork. I had been reviewing the EDx Berkeley Course on Artificial Intelligence and I found the mechanisms of Depth-First and Breath-First search to be pretty interesting. Particularly I thought having a visual representation of the pathfinding actions would both provide the type of engaging animation I was looking for and foster deeper understanding of how these algorithms operate. In this iteration of my LED array, I used the same WS2801’s from before but swapped out the combined Arduino UNO and Ethernet Shield for a single Particle Core. This is a lower voltage microcontroller with a faster ARM processor and built in WiFi (Particle has since replaced this model with the faster and cheaper Particle Photon ). I was under the initial impression that the ability to flash my code wirelessly (a handy feature of Particle devices) would be a boon to development, but I soon found that it was far too easy to overload ram with extra libraries and code, making it impossible to re-upload code over the air until you fix it will a serial upload. So as with the original Arduino I found a wired connection to be most effective. Ultimately the best approach for me was to simulate the algorithm on my laptop first, that way I could ensure that the basic algorithm was working without having to concern myself with memory constraints. I developed a simple terminal based visualization of my grid that would display asterisks to communicate a lit LED and a plus to indicate the goal location that the pathing algorithm was seeking out. This worked very well for development until I tried to cut and paste code into my project. I found myself spending close to a week debugging a memory overflow, only to finally discover that the culprit was the library (which provides tools for console output on the mac) that I was importing into the extremely memory constrained 128K Flash ram. Once I tracked down this bug the rest of them fell away fairly quick, being mostly silly and easily identifiable with a few strategically placed Serial.print() commands. Ultimately this was a great exercise. I felt it allowed me to explore the C++11 capabilities, get more experience with debugging tools and version control using Git. I’m also very pleased with the results.
Onto the next challenge.