Coding your first neopixel on MakeCode
Last updated
Was this helpful?
Last updated
Was this helpful?
Open and follow along or read the goals of this activity and try to do it as a challenge.
Have the micro:bit set up a strip of neopixels with the following conditions:
Part A
The neopixel is controlled by the pin zero (0) on the micro:bit.
The neopixel LED strip has 10 LEDs.
The colour format used is RGB.
Part B
Show the strip on the emulator. This one is trickier than it seems. Make sure to read the tip from the clear block.
When the user presses the A button, set the colours of all of the LEDs to red.
When the user presses the B button, set the colours of the LEDs to colours from the rainbow.
When the user presses buttons A and B at the same time, the neopixel will turn off (clear). This challenge is a bit trickier than it seems. It requires you to read the tooltip on the clear block.
When the user shakes the micro:bit, the pixel colours rotate within the neopixel. This process requires reading the tooltip on the rotate pixels block.
Once you have tried solving the challenges, compare your solution with our below.
Next, we dive into data activities.
We are using numbers that go from 0 to 360. These numbers represent degrees on a .