Reverse Engineering

I am rebuilding Lara’s Project.

I am starting by building the circuit, and then I will focus on the code. I connected 5 buttons, 4 LEDs, and a speaker to my Arduino like so:

Now I am starting the code by assigning each button to light an LED and play a tone. I will use arrays to store each value. Next, I need to think about why there is a button that initiates the other buttons/tones/LEDs. After consulting Lara, I am going to use a button counter. If the button counter is < 1, then the buttons/tones/LEDs will not be active. It seems as though my buttons are not being read. I will try another route, which Lara took, and assign a buttonState reader. UPDATE: My breadboard was not being powered! Silly mistake.

Now I have each button triggering an LED and sound. Hmm, one LED/sound is playing twice, I will fix that.

Button = LED + tone from Tami on Vimeo.

Now I have the initiator button working, so the buttons attached to the tones/LEDs will not work unless this button is pressed first. (I am not pressing the buttons well, so sometimes the LEDs flash twice because I pressed the button weird)

Initiator Button from Tami on Vimeo.

See the Code, and the pitches.

And finally, adding a fade to the initiator lights. I ran out of time to get this working in class, but here is my unfinished code.