// Copyright 2007, Sandeep Gangadharan // For more free scripts go to http://www.sivamdesign.com/scripts/

Beep the Horn on Code Car

 
 

Start making noise with code! Beep the horn on Code Car automatically.

Code

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.

Walkthrough Videos

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!

Challenges

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!



Concepts

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: 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.

Quiz

If you're having trouble, try to run an experimental program or look at the example code to help you find the answer.

What arguments (pieces of information) does the tone() function require? Make sure they're in the right order!