Total Eclipse of Arduino
I have frequently said disparaging things about Arduino. This invariably prompts e-mails from Arduino fans, some thoughtful and some… let's just say heated. I knew the situation was bad when I saw a Slashdot comment on an Arduino book that mentioned something about "Arduino haters like Al Williams…" (keep in mind, I was not involved in any way with the article or the discussion).
- The Role of the WAN in Your Hybrid Cloud
- Stop Malware, Stop Breaches? How to Add Values Through Malware Analysis
- How to Mitigate Fraud & Cyber Threats with Big Data and Analytics
- How to Stop Web Application Attacks
I'd like to say that I really like the Arduino. I'd like to say that, but I just can't. My recent port of lwos (which I will get back to next time) reminded me of just how much I don't like it. But wait — if you are a fan, don't stop reading to send me a nasty e-mail yet. Wait until I get to the end.
Excepting the religious wars about emacs and vi, I am a pretty moderate guy. So, in all fairness, I do like some things about the Arduino. I like that it has brought a new awareness to embedded controllers. I like that it has spawned a lot of cheap daughterboards (don't make me say shield) and clones that can fit them. I really like the Atmel CPUs — in fact, I was using GCC, Atmel, and a bootloader long before the Arduino showed up. The best thing I like is that there are a number of really cool libraries for the Arduino and that makes it very productive (although I also liked Pascal Stang's avrlib library, which had a lot of cool features too and also predates Arduino).
So, gee, that sounds pretty positive. What don't I like? Ok, I'll be honest. Part of my personality is that rabid fans of almost anything puts my guard up. Even the things that I really like, I can (and will) enumerate a long list of flaws that I wish were different. So when you tell me that some tool is perfect (except, of course, emacs which is the exception that proves the rule), I am instantly going to be suspicious.
On the other hand, I'm no fool. If something really is that great, I will get over it and get with the program. But nearly every time I use the Arduino it leaves me frustrated. I say nearly every time. I did some work this semester with a high school student and he wanted to read an IR remote in Java. We built a board, put the Arduino bootloader on it, and instantly found a really nice program on the Internet that did exactly what we wanted. No fuss. But it also wasn't the core of the project.
I recently built an Arduino library for the IDE and also ported lwos to it. The editor is handy, but if you are used to a real programming editor it is frustrating. Sure you can use another editor (and sure, I can make the same argument about many IDEs). But the editor is really super simple and while that's a good thing for a new person, it is frustrating otherwise.
The other thing that is strange is that the IDE doesn't compile your code like you would guess it does. It basically builds a big single C++ file and compiles it. It guesses (mostly correctly) what libraries you need. Mixing in C code is very ugly. C++ is a little easier, as long as you don't want to use any of the Arduino libraries in your code.
Yes, every one of these problems is surmountable. But it is an unnecessary hoop to jump. The real tool underneath is GCC and there is no reason you can't have an "expert" mode with some better editor features and more control over the build process. I get that the tool makes it easy for beginners, but it would be nice to not make the old timers cranky. Besides, it isn't just the old timers. Every beginner will eventually graduate to bigger projects and find the same stumbling blocks.
Last time I mentioned a link to instructions on how to build Arduino code with Eclipse. To tell the truth, I'm not a huge fan of Eclipse (did I mention I like emacs?) but it is certainly capable and well-known. It also has good integration with Atmel debugging tools so, unlike the Arduino IDE, you could actually debug what you write.
Nevermind that link. It was out of date and the instructions no longer worked (assuming they ever did). I did a search and found quite a few instructions that involved doing things like compiling a program in the IDE and then swiping a library file made for the project. That sounds ugly. I wanted to just use Eclipse.
I did a few experiments with the AVR plug in. My code would build, but something kept it from running properly. Then I found the Arduino plug-in here. After you get it set up properly, it manages to build a library for your target and lets you write your Arduino code with Eclipse. There is even a serial monitor view so you can interact with the Serial object in your program.
I like it. Of course, even things I like might have an issue or two. In this case, I wish there were better documentation for the plug-in, and installing it seems to double up with the standard AVR plug-in (I assume the author uses the same base). There are few spots on the website that hint that the plug-in only works on Windows, but then later notes mention that starting with version 1.2.4, it works with Windows, Linux, or OS X. It is running fine for me under Linux.
I can get cheap Arduino hardware. I don't especially dislike the bootloader. I do like the libraries. With this plug-in I can ignore the IDE and the wonky build process it uses, which is really the part I hate. Maybe this plug-in will let me love the Arduino, after all.
One thing I am interested in, by the way, is the Arduino Leonardo. I'll be talking about it soon, but it is interesting because it can impersonate USB HID devices (a topic I've talked about before with the PIC). If building an HID device is as easy as the rest of the Arduino libraries, that would be something to get excited about. Especially if I can dump the hokey IDE.