I needed a new project over the summer, and decided to try and build a Guitar Hero playing robot. All it needs is something that pushes five buttons in a set sequence - how hard can it be?
Seriously though, I thought it would be an interesting project, and as a side benefit, I'm hoping that the robot will be able to play songs that I can't with my old fat slow fingers ;)
First step of the project was to get something to interface the real world with my desktop PC. Most of the DIY projects around on the net seems to rely on the good ol' RS232 interface. RS232 is excellent, don't get me wrong, it got me through uni. However, most new PCs no longer have RS232 ports built in, and certainly, my current PC and my previous PC don't have one. So I needed something else.
This is were the USB port comes in. I've never played around with the USB port, so deciding on a project that relies on the USB was a gamble, yet alluring. I thought it would be really interesting to play with the USB at a low hardware level, and even if my robot doesn't work out, at least I come out with some knowledge of USB development.
I looked around the net for DIY USB projects, but they were hard to come by. Either they were overly complicated, or they were too expensive, or both. I needed a reasonably cost effective way to interface the PC to the real world. I initially decided to use the
USB Experimenter's Interface Kit from Jaycar. But then, when I discussed it with my friend, he recommended that I try the
Arduino Duemilanove from Little Bird Electronics. He read it in one issue of his fancy Wired magazine. It's an open source development board, with a
very active community. This was a perfect fir for what I needed. It was cheaper than the Jaycar unit, come already assembled and open source so that it should be much easier to hack. I ordered one straight away.

That was last week, and this morning, the Arduino finally arrived! Initial impression was "wow, it's tiny". And it really is - it's smaller than a business card.
I followed the
instructions and downloaded and setup the Windows drivers and software. Pretty straight forward.
I then followed the instructions and uploaded the sample test sketch
"Blink". The instructions mentioned sticking in an LED to pin 13 and ground, so I was fully prepared to pull out the digital multimeter to measure the output voltage to check. But the newest Arduino that I purchased, the Duemilanove come with an LED built into the board! Awesome! Once the "Blink" was uploaded, the onboard LED started to blink as it was meant to. Couldn't believe how easy it was to get this going.
Next I decided to try something a bit more challenging. There is a sample sketch called
"Dimmer" which allows to control the brightness of the onboard LED by moving the mouse on the PC. I thought this would a good example because it demonstrates something that I need for the roboto project - control the Arduino directly from the PC.
I uploaded the sketch just like I did for "Blink", and once it was uploaded. I moved my mouse around, but nothing. I checked the code, changed a few lines around, uploaded again, moved the mouse around - nothing.
I read the code, and it kept on mentioning 'processing'. I didn't know what it was referring to. Then I saw a small link to
processing.org. I followed the link and found that it was a link to an open source programming language and environment. This solved another one of my issues - I thought I would have needed to find and install Visual Studio so that I could write programmes in Visual C++ or Visual Basic. Having Processing installed negated that need! Awesome.
I put that Processing sample code from "Blink" and ran it. It popped up with a little window and when I moved the mouse side to side within that window, the onboard LED turned on and off. I guess the onboard LED is binary and have no analogue option. But the important thing was that it was working! Yay!
Reading through "Blink" I realised what I needed to do for the robot project. I need to put the Arduino into monitor mode, where it will sit there and monitor the incoming serial signal and then press the Guitar Hero buttons when asked. The Processing sketch will read a text file with the song transcribed and send the commands down the line to the Arduino.