Datasheet
CircuitPython NeoPixel
NeoPixels are a revolutionary and ultra-popular way to add lights and color to your project. These stranded RGB lights
have the controller inside the LED, so you just push the RGB data and the LEDs do all the work for you! They're a
perfect match for CircuitPython.
You can drive 300 pixels with brightness control and 1000 pixels without (set brightness=1.0 in object creation). That's
because to adjust the brighness we have to dynamically re-create the datastream each write.
Here's an example with a lot of different visual effects you can check out. You'll need the neopixel.mpy library file if you
don't have it yet! (https://adafru.it/y8E)
# CircuitPlaygroundExpress_NeoPixel
import time
import board
import neopixel
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=.2)
pixels.fill((0, 0, 0))
pixels.show()
# choose which demos to play
# 1 means play, 0 means don't!
simpleCircleDemo = 1
flashDemo = 1
rainbowDemo = 1
rainbowCycleDemo = 1
def wheel(pos):
# Input a value 0 to 255 to get a color value.
© Adafruit Industries https://learn.adafruit.com/adafruit-circuit-playground-express Page 124 of 211










