Learn to blast your laser LEDs into space to break up obstacles at the press of a button.
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.
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.