|
|
|
|
|
by larve
5356 days ago
|
|
Arduino is C++. Plain and simple. Just like Processing is java. the arduino GUI just adds some lines in front of your code, and passes it over to avr-g++ along with some flags. It links the whole thing to what it calls "arduino cores" and of course the additional libraries. You can find all that stuff inside the Arduino folder (or on macosx inside the Arduino.app) in the Resources/Java/hardware/arduino/cores/arduino folder. After that, it just does: int main(void)
{
init();
setup();
for (;;)
loop();
return 0;
} The one thing that is slightly annoying with arduino is how terribly inefficient the libraries are. For example, digitalWrite is like half a gazillion cycles (I remember counting, it was well in the 3 digits), while it's one cycle if you use the normal approach (port |= _BV(bit)). Also, the initialization code snips one timer interrupt from you, which can be annoying as well. The way around that, because I actually like the fact that I can just reuse some library for whatever chip is around (something that is definitely not common in the embedded world) is to just remove the call to init() in the main.cpp file. The rest is really just C++, with all the avr includes and co available. You also just need to dump whatever source you have available into your library folder as well. |
|
http://arduino.cc/playground/OpenBSD/CLI
Most of the non-IDE toolchains I've encountered were horrific monsters, including several TextMate bundles. I wonder how worthwhile it would be to create a simple wrapper a la dotcloud's deploy utility, or Rails' initial project build.