Blink both of the siren lights to learn about combining code commands. Get creative with your light patterns!
New Concept: Using Speed as a Tool
You already know that computers can run code really quickly. So quickly that your eyes can't even see it! If you want to make two things appear to happen at the exact same time, that's pretty easy to do on Code Car- just type the code commands one line after another with no delay in between.
New Concept: Finding Patterns
If you were successful in both challenges on this program, you probably figured out that there is a pattern that you can follow to complete a task. In this program, for example, the pattern for adding a new LED light is:
1. Add a pinMode command for that light.
2. Add a digitalWrite( , HIGH); command next to the other digitalWrite( ,HIGH); commands.
3. Add a digitalwrite( ,LOW); command next to the other digitalWrite( ,LOW); commands.
Once you know the pattern, you can imagine how you'd add any number of LED lights to the program! Don't be spooked as programs get larger- there are almost always patterns repeating throughout.
To make two things appear to happen at the same time, you need to ___________.
If you don't type everything perfectly in a code comment or you forget to type one, what will happen?