Trying (Piano Fingers!)

Hi Guys,

As someone very new to this and to the class(though I’m sure most of you are too)- I’ve tried for the last few days to just situate myself with the arduino. After watching countless tutorials and trying to read the manual, I found that I understood some things. After trying to teach myself, I’ve learned how to blink lights, and that I probably should have came in for some help.

To make this slightly more interesting, I wrote the code for the blinking to the song “Mary Had A Little Lamb”

The first five fingers represent the first five LED lights. Watching the LED lights as you play on the piano simultaneously would allow you to play the first part of that song.

Ideally, the blinking lights could correspond to a key on the piano to provide visual stimulus to music. This could be a musical learning product.

IMG_2261

 

void setup() {
// initialize the digital pin as an output.
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);

}

digitalWrite(10, HIGH); //
delay(50); //
digitalWrite(10, LOW); //
delay(10); //

digitalWrite(11, HIGH); //
delay(50); //
digitalWrite(11, LOW); //
delay(10); //

void loop() {
digitalWrite(12, HIGH); //
delay(50); //
digitalWrite(12, LOW); //
delay(10); //

digitalWrite(11, HIGH); //
delay(50); //
digitalWrite(11, LOW); //
delay(10); //

digitalWrite(10, HIGH); //
delay(50); //
digitalWrite(10, LOW); //
delay(10); //

digitalWrite(10, HIGH); //
delay(50); //
digitalWrite(10, LOW); //
delay(10); //

digitalWrite(10, HIGH); //
delay(200); //
digitalWrite(10, LOW); //
delay(10); //

digitalWrite(11, HIGH); //
delay(50); //
digitalWrite(11, LOW); //
delay(10); //

digitalWrite(11, HIGH); //
delay(50); //
digitalWrite(11, LOW); //
delay(10); //

digitalWrite(11, HIGH); //
delay(200; //
digitalWrite(11, LOW); //
delay(10); //

digitalWrite(10, HIGH); //
delay(50; //
digitalWrite(10, LOW); //
delay(10); //

digitalWrite(9, HIGH); //
delay(50); //
digitalWrite(9, LOW); //
delay(10); //
digitalWrite(9, HIGH); //
delay(50); //
digitalWrite(9, LOW); //
delay(10); //

 

}

Leave a Reply