Over the break I was able to pick up an OSEPP Uno (Arduino compatible board) to start fooling around with. I have been looking at a lot of projects and facts about the hardware, checking its capabilities and potential as a learning tool. This weekend has been about two things, playoff football and arduinos.
Being fairly new to the hardware side of things with basic programming knowledge, I started very simply with LEDS. To build off the typical LED blink program, I wired a switch that controls the LED being on or off.
Now that is kind of cool to see it first work, but wanted something a little more exciting. I hooked up 3 LEDs to different pins on the arduino to have individual control. I thought it would be cool to have each LED correspond to a musical note that could light up when a song played. I only had enough wires for 3 LEDs, so picked the song Hot Cross Buns to use since it uses three notes.
The program was made to read a string consisting of letters (corresponding to notes) and numbers (corresponding to timing). The program goes through the string to each character, seeing what the note is and its duration (quarter, half note etc). The proper LED is then activated using the information. The string for Hot Cross Buns looks like this:
Unfortunetely I did not have a piezo element to generate the accompanying sounds when it plays, so for this video I just played the song off my laptop while it was going.
It was fun to try some things with the arduino and get a better feel for the hardware. I am now using these tests to aid my project development, which will be updated on here in a couple days.