Sunday, May 8, 2011

Hello Arduino

I've built the Arduino IDE from source on my SnowLeopard laptop. Pretty easy. Just grabbed the sources with git, cd Arduino/build, typed ant. A minute later and voila, I ran it, compiled the Blink example for my Arduino lilypad board, and away it blinked.

Poking around the built app I was curious about how the "Sketch" code was being compiled and linked. I found a tools directory inside the app (Arduino.app/Contents/Resources/Java/hardware/tools), which contained an avr directory. Inside that was obviously some kind of gcc toolchain for AVR microcontrollers. After a little research, I found newer versions of these tools called the AVR CrossPack. I downloaded, installed, and created a symlink:
mv avr avr.old
ln -s /usr/local/CrossPack-AVR ./avr
I was able to rebuild all my Sketches with the new tools installed thusly. Nice to know how to do these things.

I now realize how many details the IDE is handling for me, and I'm appreciating it. The learning curve is much shallower not having to be bogged down by the underlying tools.