You'll need to log in from a computer to start Learn Hardware Programming with CircuitPython. But you can practice or keep up your coding streak with the Codecademy Go app. Download the app to get started.

Learn

So now we know how to turn all the lights into a single color, but how do we turn individual lights on?

Circuit Playground Express has 10 built-in NeoPixels, numbered counterclockwise:

• `cpx.pixels[0]`
• `cpx.pixels[1]`
• `cpx.pixels[2]`
• `cpx.pixels[3]`
• . . .
• `cpx.pixels[9]`

To make the NeoPixel at `0` turn on to red one time:

``cpx.pixels[0] = (255, 0, 0)``

To make the NeoPixel at `0` turn off:

``cpx.pixels[0] = (0, 0, 0)``

Note: Colors are stored as tuples by default. However, we can also use hexadecimal syntax to set values similar to colors on the web. For example, `0x100000` is equivalent to `(10, 00, 00)`. Translated to decimal, it is `(16, 0, 0)`.

### Instructions

1.

Let’s make colors appear in a rainbow-like fashion! 🌈

Inside the `while` loop, set the NeoPixels into these colors below:

• Red: `(255, 0, 0)`
• Orange: `(255, 85, 0)`
• Yellow: `(255, 255, 0)`
• Green: `(0, 255, 0)`
• Forest Green: `(34, 139, 34)`
• Aqua: `(0, 255, 255)`
• Blue: `(0, 0, 255)`
• Dark Blue: `(0, 0, 139)`
• Purple: `(255, 0, 255)`
• Indigo: `(75, 0, 130)`
2.

New colors should show up!