Your circle of LEDs can be used for many things: signals, status indicators, or just cool patterns! Learn how to run them in a circular cycle.
The code below already works and is ready to upload to your Code Rocket! Then take on the challenges and see what changes you can make to create an even cooler project!
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: New approach, same outcome
You’ve been turning on and off LEDs a bunch of different ways while programming the Code Rocket. In fact, you already had the skills to make a light pattern like this way back with project 3 or 4! In this project, you see a new tool being used- the ‘count with’ loop (called a ‘for’ loop in typed code) - to accomplish a task that would take many lines of code if you just used digitalWrite() and delay() commands to accomplish the same task. And when it came time to add more LEDs, like the challenge prompts you to, you’d be adding lots and lots of lines of code to get there.
Programmers are always looking for ways to use technology to make their code easier to write, run, and understand. As you add more tools to your mental toolbox as a coder, you might want to revisit some of your older programs and see how you could improve them.