Combine your knowledge of variables, statements, and loops to create a light pattern on the LED circle of 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.
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: Conditions, conditions
When your program’s action is based on a condition as simple as ‘pressCount’, you can see how you can quickly build a complex program with very few inputs. This project is similar to the ‘Space Headlights’ project, but it takes the idea further about how many pressCounts you can have. When your button input increases the value of a variable, there’s almost no limit to how many different outcomes you could have. You could even have a special number of presses that triggers a ‘secret’ reaction.