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!
I also decided to try both exercises and got the first one figured out but am hung up on the second one with the bouncing effect. did you ever get that exercise figured out? I have tried several things but I'm just not getting it. If you did get it to work and wouldn't mind providing a little push in the right direction that would be great.
ReplyDeleteSD
Hi, Steven.
ReplyDeleteI wrote up about mod2 here:
http://handsonarduino.blogspot.com/2011/01/project-6-modified-project-2.html