I was able to get my
NeoPixel stick working under
MicroPython on my ESP32-PICO-D4 controller.
The picture doesn't do the color presentation any justice. Looks great live.
I can see this being used to create outdoor billboards. A string of NeoPixels to decorate a Christmas tree is another idea.
import machine, neopixel
n = 8
p = 5
np = neopixel.NeoPixel(machine.Pin(p), n)
np[0] = (255, 0, 0)
np[1] = (0, 255, 0)
np[2] = (0, 0, 255)
np[3] = (128, 0, 0)
np[4] = (0, 128, 0)
np[5] = (0, 0, 128)
np[6] = (125, 204, 223)
np[7] = (255, 0, 153)
np.write()
This example I converted from CircuitPython displays a rainbow effect.
NeoPixel Rainbow video clip. I hide the stick to cut down on the glare.

# MicroPython demo - NeoPixel
import time
import machine
import neopixel
pixel_pin = machine.Pin(5)
num_pixels = 8
pixels = neopixel.NeoPixel(pixel_pin, num_pixels)
def wheel(pos):
# Input a value 0 to 255 to get a color value.
# The colours are a transition r - g - b - back to r.
if pos < 0 or pos > 255:
return (0, 0, 0)
if pos < 85:
return (255 - pos * 3, pos * 3, 0)
if pos < 170:
pos -= 85
return (0, 255 - pos * 3, pos * 3)
pos -= 170
return (pos * 3, 0, 255 - pos * 3)
def rainbow_cycle(wait):
for j in range(255):
for i in range(num_pixels):
rc_index = (i * 256 // num_pixels) + j
pixels[i] = wheel(rc_index & 255)
pixels.write()
time.sleep(wait)
while True:
rainbow_cycle(0) # Increase the number to slow down the rainbow