Start making noise with code! Beep the horn on Code Car automatically.
The code below already works and is ready to upload! Upload the code to Code Car and see what happens. Then, you'll 'take apart' the code to learn what each piece of the program does.
Watch the videos for line-by-line explanation of how the example program works. Then you'll be ready to make some changes of your own!
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!
These are the new code concepts covered in this example program. To become a great coder, read through these concepts to learn new vocabulary.
New Concept: Comments as Experiments
Coding is a series of experiments to get a final result. You may come up with an idea, test it, observe the result, and then modify your idea, test it, and so on. When you're new to coding, the typing of code can be a challenge, so you can use comments to remove code from your program without deleting it. Remember, the computer doesn't read your comments, so if you place two forward slashes (//) in front of a line of code, it's the same as deleting it (to the computer). But if you want to get that code back into your program, just delete the two slashes and the code is back in action!
New Concept: Code Won't Stop Without a Command
You saw this concept in action if you completed the challenges of this lesson. By 'commenting out' noTone() , you removed the only thing telling Code Car's horn to stop blaring! This might have been a reminder that your program doesn't "know" what you want it to do. You're in control, and the program simply runs your commands.