Blaster Buttons

Learn to blast your laser LEDs into space to break up obstacles at the press of a button.

Code

The code below already works and is ready to upload! Upload the code to Code Rocket 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

Can you complete the challenge? Change the code in the editor above, then upload it to your Code Rocket and see if you got the result.

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: Multiple ‘if’ statements

In this program, you see that the code can react to two different inputs (the only two inputs you have on your Code Rocket) and react differently to each of them. Every time the void loop runs, the ‘condition’ of each ‘if’ statement is checked and the ‘action’ is run if the condition is true. If both of the conditions are true, both actions will run on your Code Rocket.

Quiz

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

1. What code commands can run as an 'action' inside an 'if' statement?




2. How many 'if' statements can you have in a single program?