Even astronauts need to relax sometimes. Use the random function to create a color and light party on the Code Rocket.
The code in the editor below already works Just plug in your Code Rocket and press upload to see what it does! Tinker with it and make changes to see what each line of code controls.
Concept: Random, continued
In this project you’ll continue to explore the random function and see that it can be dropped in place of any number or group of numbers in a program. As your code statements get more complex, you’re probably seeing the importance of paying attention to your syntax. In this program, for example, you have a random function inside a digitalWrite function, which is inside a the void loop function. Syntax can be tricky to keep up with, but it’s what allows your code to have more ‘layers’ like this program does.