Make Code Car's horn honk a little higher each time you honk it, or create a rising tone 'honk' that turns into a dog whistle!
How many can you complete? Change the code according to the challenges below. Upload your code to see the effect when you're finished. Complete a challenge? Check it off the list!
New Concept: Updating Variables in the Loop
In the last lesson, you learned about replacing a variable for a fixed value, like a pin number. When the program is running, the button that activates the horn probably shouldn't change- that would be some strange code! But in this program, you start to see the value of a variable that can change as the code runs. This makes for much more interactive programs since the program is always updating.
You can refer to a variable that replaces a constant number as a constant variable. A variable whose value changes throughout a program is a non-constant variable.