Tuesday, September 15, 2009

Introduction to Arduino


Our first major task outside of class was to prepare an Arduino lamp.

I have never used an Arduino before this, and let me just say that I am extremely impressed with how versatile the little thing is. I found a large collection of Arduino projects online that are inexpensive and yet extremely useful, as well as things that are just plain neat. If I had the time or patience, I would develop something controlled by a Wii Remote.

Development of the lamp was fairly straightforward, following the tutorials I came up with this (shredded toilet paper in place of tissue paper).


After I got everything set up, I started to consider the neat things that I could do with it. I had a Guitar Hero controller sitting right in front of me, and the button colors got me thinking - why not have it play a Guitar Hero song?

I went on a hunt online for an idea for what song to use, and came up with this guitar hero pattern, pulled from a full-length pattern at SlowHero:

Which corresponds to the opening to Guns N' Roses' Sweet Child O' Mine. I can't think of anything that would be more fitting... too bad I don't yet know how to get the Arduino to play music (the Arduino can interact with AppleScript, so it may be possible to get it timed to play the song with iTunes, and restart it every time the loop resets).

The code for the loop is really quite easy, though it took a little bit of experimentation to get the Arduino timed to the music correctly. I used a constant set of on/off triggers to get through the notes, and then set it up so that the loop would restart properly, without leaving a light on at the end.

Two issues came up. One, timing. It took me about 10 minutes to tweak and record until I got the Arduino to line up to the music for 15 seconds, which was all I really needed. Second, the cover. I came up with something that I thought would look better than it does, but on the plus side that isn't a cube.

Overall, I'm happy with the lamp, especially with the fact that it syncs up to Sweet Child O' Mine... Enjoy!




No comments:

Post a Comment