On page 58, the author provides a couple of extra exercises that are modifications of the Project 6 code. I decided to try my hand at the first one (second one to come) and gave it some thought today. The goal is to take an even number of LEDs and have the outer edges light up and then continue inward to the center of the line and then bounce back... so an even number of LEDs will work best... for this modification, I removed an LED so I have a total of 8 LEDs in the circuit.
After trying to download the code to the Arduino, I encountered numerous syntax errors that were easy to fix (most of them involved forgetting to change a variable name to the new variables I created)... after fixing the syntax errors, the code downloaded and I was very happy to see it working as I hoped it would... see video below. (You can also download my modified program by clicking here.)
I left the 5k potentiometer in the mix as it allows me to control the speed of the two LEDs that light up... a very cool effect!
Hi, Steven.
ReplyDeleteI wrote up about mod2 here:
http://handsonarduino.blogspot.com/2011/01/project-6-modified-project-2.html
Project 12 Beginning Arduino (different song)
ReplyDeletehttps://www.youtube.com/watch?v=1BFO2gDwM6I
ReplyDelete