Custom Search
Project 1: Arduino Setup


Introduction

OS: Ubuntu 8.10
Board: Arduino Duemilanove (ATMega328)
Other: Starter Kit from Hacktronics
Time: ~2 hours (software download time varies)

And so it begins...

After many nights spent clearing space for my feet and beers on GHZ's coffee table, and wondering wtf he was doing with the soldering iron and radiation sources, I decided to score myself an Arduino Duemilanove from Hacktronics. Awesomely, they shipped it to me within days, and included some OEM Watermelon candy. You can't argue with prime customer service.

This writeup covers the unpacking of the hardware starter kit, the installation of the Arduino software on Ubuntu Contaminated Catastrofuck...er... 8.10, and getting the first Blink example up and going. Is this worthy of being on the Internet? Probably not, but dude, if you're here then you probably have browsed out the rest anyways.
-------------------------------------------------------------

The Beer

What would experimentation be without corresponding intoxication? Its cliche, but its true. Not only is this site going to serve as a project dumping ground, a place for horribly drawn webcomics, a reason to pay GoDaddy for domain reg, and a place for me to vent my unyielding cyncism, but it'll also be a beer blog. Fuck yeah, go Web 2.0.

Also sponsored by, The Royal League of Bunnies The beer of choice for this first misadventure is Rogue Morimoto Soba Ale. Rogue themselves say that:

"The delicate flavor of our roasted Soba brings a nutty finish to this light and refreshing ale. A perfect accompaniment to lighter cuisine."

It pours nicely, with a deep golden color. Both the color and the aroma made me think this was going to be a pretty hoppy ale, bordering on IPA. Its not. It smells hoppy, and its clear, but its got the body and smooth, velvety dry flavor of a wheat beer. Elsewhere on the vast internets, I've heard it compared to the flavor of buckwheat pancakes, which sounds about right. Its almost a comfort-beer, which is odd in something so light of color, but very smooth and quenching. Who knew soba was good for something besides overpriced buckwheat-husk pillows? Apparently the Japanese, and Rogue breweries.

On the OBI Completely Random Beer-o-meter Scale, I give it a 7.3.

-------------------------------------------------------------

Step 1: Unpacking the hardware

Imagine this, only brighter... The starter kit was pretty complete. Arduino board, 6' USB cable, solderless breadboard, LEDs, resistors, wires. Since my old breadboard from college has probably gone to some alternate Schrodingerian dimension and is currently having an orgy with my missing one-off socks, my old TI-86, spare change, and my last shred of dignity, it was nice to have everything all in one box. The one potential drawback to the kit being that it only comes with a standard USB cable, which is not gold plated, nor spiral shielded and triple redundantly reinforced with space age materials. Hopefully, I will survive...

But I digress...

As advertised, pop the usb cable in, and the board was recognized and put on /dev/usbTTY0. It also got power and, much to my chagrin, gave that power to the LED I had sort of forgotten I attached to pin 13. Note to self: "shit be bright, yo".

-------------------------------------------------------------

Step 2: Installing the dev kit

The Arduino Learning section is straightforward and pretty much complete for getting everything going. Essentially, at least for my installation on Ubuntu Herpetic Heroin-wHore, it boiled down to:

sudo apt-get install gcc-avr avr-libc librxtx-java avrdude

Then downloading and installing the Arduino software tarball for the java GUI. NOTE: I am still working on getting makefile uploading working. For some reason, I can't get the makefile to compile my blink.pde as yet, but the Java GUI works.

Also, I had to use the tweak detailed here for 8.04, as the librxtxSerial.so file in the arduio-0015 install was not correct for my architecture...or something, which when running the 'arduino' command resulted in the error message:

Exception in thread "main" java.lang.UnsatisfiedLinkError: $ARDUINO_HOME/lib/librxtxSerial.so: $ARDUINO_HOME/lib/librxtxSerial.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)

Once I figured that part out, the GUI popped up fine when i ran 'arduino' from the install directory. And off I went...

-------------------------------------------------------------

Step 3: Hello World (1 second pause) Hello World (1 second pause)...

Unaware that all the sample programs from the Arduino website are available in the default install, through a submenu in the GUI, I went and grabbed the blink.pde code off the learning page, and created a subfolder for the project in my sketches directory (defined when the arduino GUI fires up). Hooray redundancy! If I wanted to pay attention to "details" I would have been a doctor.

This is where things got entertaining.

Both the downloaded code, and the included code compiled fine, which is to be expected, since they were, as I mentioned, the same. But, when trying to upload the code to the board I received:

avrdude: stk500_recv(): programmer is not responding

The amber LED is the built-in one on pin 13, its blinking Which, when googled, returned a lot of scathing indictments of the Italian Postal Service, which by itself sounds analogous to Military Intelligence, or the Canadian Navy, or the French, or the American Banking System... Turns out, in many cases this error means the board is somehow non-functional (like the aforementioned list...I kid because I care). In other cases, such as what I found out, it means you have to get funky with the reset timing on the board as you upload. I eventually settled on reset within 1 second-ish before hitting the "Upload to I/O Board" button on the GUI. After figuring this out, I had myself an amber LED blinking every second.

(As an aside, here is another solution for the stk500_recv error that doesn't include the Italian Postal Service. Also, some other interesting projects on the site. *cough*)

And that...was pretty much that.


Last Updated: August 5, 2010 Copyright 2010 - Infinity, Waldo News Network. All Rights Reserved.
Home | Archives | Travel | OBI | LTF