Friday, March 2, 2012

Using Eclipse with Arduino




In the last adventure, I experimented with a simple LED project to control several LEDs and turn them on and off. This was very instructive and I learned several things about setting up projects and working with the Arduino. One of the things that was most obvious, was that the IDE is very limited in its capabilities. It seems very appropriate for small projects, but it is unclear how well that scales to larger multi-library projects. I thus began a quest for a better development environment.

I began experimenting with using the Arduino plugin for Eclipse. I use Eclipse at  work and figured it would be easy to setup for development at home. A googling of possible plugins turned up exactly what I was looking for: http://avr-eclipse.sourceforge.net/wiki/index.php/Plugin_Download. First, I installed the Eclipse CDT package. Then clicked Help->Install new software. I then added the link to install the package (as specified on the web page and shown below):


After this was done, I then needed to update several of the paths in the configuration. Under Eclipse->Preferences I set the path to avr-gcc which was installed as a part of the Arduino IDE. This took a little experimentation as the paths to use were not immediately obvious. Finally, I arrived at what is shown below and that seems to work:


I was then able to create a new Arduino Sketch. This was close to what I was looking for, but still not quite right. This did not quite give me complete control over library and test layout. Another googling turned up a cmake module for the Arduino: https://github.com/queezythegreat/arduino-cmake.

I followed the instructions in the readme for setting up a project using the macros provided and was able to build a library and test module with not too much effort. In the next installment, I will redo the LED experiment using the new build environment.

No comments:

Post a Comment