External Strips

MakeCode provides a rich library to more NeoPixel strips (see the API reference) connected on the pins of the Circuit Playground.

If you want to support an external NeoPixel strip, not the 10 built-in LEDs, you can create a strip instance and store it in a variable. You can configure the number and type of LEDs.

// mount an external Neopixel strip on pin A1 with 24 RGB pixels
let strip = light.createStrip(pins.A1, 24);

The example below mounts a NeoPixel strip on pin A1 and turns it to blue or red when buttons A or B are pressed.

To set all the colors on the pixels, use setAll:

// show blue on all pixels

You can also use the set pixel color block to set an individual pixel color.

// set colors one by one
for(let i = 0; i < strip.length(); ++i) {
    strip.setPixelColor(i, Colors.Green);
Last updated on 2017-11-11 at 12.52.11 AM Published on 2017-05-30 at 12.36.26 PM