As a relative late comer to Arduino world, I went through the beginner tutorials and examples
using the provided Arduino IDE. I faithfully downloaded it from arduino.cc
web site, took a quick tour and was pretty unimpressed with the set of features. For one, I am
very particular about the color scheme of my programming editors, and not having a choice
was an immediate downer.
Arduino IDE is simple to use, and I think this was one of the key design goals for this software.
It is commonly used to introduce many folks to programming electronics, and just programming,
notably in C/C++. As such, this tool is pretty limited, and limiting too. Very quickly I found
myself very stuck unable to browse through external symbols by clicking through them, using auto-complete
features, refactor code, and so on: all the "basic" features I so got spoiled with, by tools such as
JetBrain's RubyMine, AppCode, IDEA,
open source (but originally IBM's) Eclipse, and not to
mention Apple's XCode.
After going through several example projects using the IDE I became more and more frustrated with
its limitations. Programming hardware is hard enough (pun intended), and the IDE is supposed to
make life easier.
- How do I explore the source code of the included libraries that are being used by my sketch?
- Why does "Import Library" insert a new
#include into my sketch when I already have one?
- Why is tab indentation not maintained as you move to the next line while editing?
- Why is the board and port selection remain global, and are not assigned to each sketch? Can't I be working on multiple boards at the same time, especially, say, when they talk to each other?
- And of course... why can't I change the goddamn colors :)
So I became worried that my foray into electronics would die young if I didn't find a more capable
programming alternative, and so I started exploring.
Arduino IDE Alternatives
First off – a tiny disclaimer: this is not a feature by feature comparison of Arduino-capable IDEs.
It's a personal opinion of an experienced software engineer, who recently entered this domain. I work
on Mac OSX, and so I only briefly mention the Windows options. But on a Mac I did end up trying most of the options listed here.
When I talk about software IDE, I generally do not mean a fancy text editor. While I know
that plenty of great developers love and use text editors on complicated software projects,
the convenience of a true IDE on a small to mid-sized software project is hard to dispute.
So while I do, when appropriate, use a combination of VIM or TextMate for exploring or quickly editing,
I prefer to actually write code in a true IDE. If I had to define what true IDE means for
me, I would list the following features:
- full indexing with ability to click on a symbol or use a key shortcut to go to the definition or source file where that symbol is defined
- in-place documentation lookup for APIs
- code auto-complete (configurable, and not automatic – key press invoked)
- code auto-format with automatic tab positioning while editing
- refactor (extract method, etc)
- symbol rename (automatic renaming of functions, class names with file name change, variables, etc across many files)
- built-in debugger
- automated test integration
- arguably less important are global project search, global find and replace, project-level symbol lookup.
My absolute favorite over the years have been the series of IDEs for all popular languages produced by
JetBrains –– a company that singlehandedly dominated the IDE nitche
for over a decade now, including winning over droves of professional java programmers away from Eclipse.
But anyway, here is the list of what's available for proper software development of the code, with Arduino
as the final destination:
(screenshot courtesy VisualMicro)
embedXCode – use XCode 4 or XCode 5 to write
Arduino sketches. I tried to install this, and was able to pretty quickly compile a sketch.
But to be honest, I never loved XCode to begin with. It's gotten infinitely better over the years,
but something about it's Preferences screens is so incredibly daunting, that I never got really
good at XCode. Perhaps someday :)
(screenshot courtesy StackOverflow)
- This brings us to the last contender: Eclipse. Eclipse has been
around for a long time, and is an amazing platform for so many things, including software development.
Having used Eclipse on several Java projects in the past, it seemed the most natural fit. So I
downloaded the Eclipse Arduino Plugin, and that's what the
rest of this post is about.
Eclipse Arduino Plugin Saves the Day
Having now used this IDE for several weeks straight, I am pretty happy with the Eclipse Arduino Plugin.
The project is pretty active on GitHub, and the author is also
quite nice :)
The Case for Open Source
One of the first things I bumped into, with the nightly build of the plugin and with my Arduino Esplora board,
was a pretty major problem: I couldn't upload any sketches. So I posted a bug report on GitHub, and author replied with a quick note on how
to get the source of the plugin, and which class to look at, so that I could fix the problem. It sounded
like a challenge. Of course I took it.
For the next few hours instead of working on my Arduino sketch I was fixing the Eclipse plugin. To my surprise, it was
relatively easy to get setup with the environment where I imported the entire plugin source into JetBrains
IDEA (haha, sorry Eclipse! You are still number two :) and was able to diagnose and fix the issue with
the timing of opening serial port and uploading the sketch. A few hours later my pull request was
and the nightly build of Eclipse Plugin started working for everyone with Arduino Esplora! That, my friends,
is the true power of open source.
While I was at it, I also updated the README
with proper markdown and (perhaps) slightly better English. And of course I couldn't stop there either,
and continued going slightly crazy, massively refactoring serial communications of the plugin deep into the night,
and then submitting a beautiful pull request. However, at that
point the plugin author probably had gotten pretty annoyed that I was making his code look and work
a bit better, and sadly rejected the PR, explaining that another rewrite of serial comms is happening.
Oh well, at least I can keep using my fork on my own machine, where I get to see pretty error messages that actually
explain what's going on :)
But I digress.
Installing Eclipse Plugin for Arduino
Option 1: probably the simplest way to get started is by downloading the nightly build,
in my experience they've been pretty stable. The single-file download will already contain a compiled binary
(called something like "arduinoEclipse.app" or similar), and you can just run it.
Option 2: But my preferred way to install the plugin is to first install a full version of Eclipse Luna for C/C++,
and then add Arduino plugin to it via software installer.
↳ Keep reading …