My life is an endless series of mistakes. What keeps it interesting is that I never consciously repeat the same mistake twice. For example: When it comes to selling robots I believe in “eating your own dog food” – using the exact same machine in the lab that I give to paying customers. …but I only have one Makelangelo set up for development work. It’s always changing and uses a MEGA that I’ve had lying around forever. MEGAs have more RAM than UNOs and the last few versions of the firmware used too much – even a simple command would overflow the stack and reboot the Arduino. Typically what people would see is the HELLO WORLD message repeating after every other line.
I found the bug last night at the Vancouver Hack Space Super Happy Hacker House XXV. I wanted to prove something to myself by opening a kit, assembling it, and drawing with the robot before the festivities were over. In spite of my experience I wasn’t able to do it.
First, the motor mounts cut from 4mm acrylic were too thick for the M3 screws, and the VHS had run out of screws. I ran downstairs to the laser room and cut new motor mounts from birch… but the space had no glue to assemble them. Loial (who is awesome and building a huge 3D printer called Tiny) was able to scrape together 4 M3 screws that were long enough. We got the whole machine mounted without trouble. Paul, Luke, and Steven pitched in to put the motors next to each other and run the string around the edge of the 250cm*100cm white board through some eye bolts. Emily contributed some awesome wool for the string. Then it came time to jog the motors, and there the trouble began. I was finally seeing the firmware bug that’s been reported on github and in the forums.
This morning after a long walk with the dogs I jumped online and the good people of irc.freenode.net##arduino showed me a great trick for reducing memory usage: wrap all your strings in F().
should be written as
As kline said, “moves read-only data out of ram and into read-only progmem”. It also made the sketch size almost 2kb smaller. Nice!
So a big thank you to everyone who came out last night and all of you online for your words and dollars of support. I really feel the love and I only hope I can return the favor in kind.
TL;DR: I wasn’t eating my own dogfood and now you all need to upgrade to fix my bug. I’m sorry.