adding a neopixel stick to the stm32 feather

In December 2021 I wrote about bringing up the Adafruit STM32F405 Feather ( ). Since that time I added an external Neopixel Stick from Adafruit ( ). This is the four “color” version of the stick with red, green, blue and white LEDs on each device. I cleaned up and shortened the code from the last post and got a bit more creative strobing the LEDs. The stick strobes a single LED from end to end, while the on-board LED shows the same color being strobed on the stick. Once again it’s Circuit Python version 7.1.1. Wiring for the stick has the stick’s ground attached to the feather’s GND pin, the stick’s 5V pin attached to the feather’s USB pin, and the feathers DIN (data in) pin attached to the Feather’s D5 pin, and configured in the call to neopixel.NeoPixel(...) (code line 13).

import time
import board
import neopixel

# For the single neopixel on the feather itself.
sneopixel = neopixel.NeoPixel(
    board.NEOPIXEL, 1, brightness=0.2, auto_write=False, pixel_order=neopixel.GRB

# For the eight neopixel board attached to the feather.
pixelboard = neopixel.NeoPixel(
    board.D5, 8, brightness=0.2, auto_write=True, pixel_order=neopixel.GRBW

def cycleColor(color):
    for i in range(len(pixelboard)):
        pixelboard[i-1] = (0,0,0,0) # turn LED off
        pixelboard[i] = color

while True:
    cycleColor((64,0,0,0)) # red
    cycleColor((0,64,0,0)) # green
    cycleColor((0,0,64,0)) # blue
    cycleColor((64,16,0,0)) # orange
    cycleColor((0,32,32,0)) # cyan
    cycleColor((0,0,0,0)) # black (LED off)

The video was produced on my iPhone 11 Pro with Apple’s iMovie. I know it’s crap as in it won’t earn any awards unless there’s a special Raspberry for iPhone clips, but I didn’t feel like firing up one of my regular cameras and going through the rigamarole of filming, transfer, post-processing, then posting. Making the short clip on the iPhone was incredibly easy and fast. Going through one of my cameras (either the E-M1.2 or the Lumix G9) wouldn’t have looked any better, and probably worse. The problem is that the LEDs in the video clip don’t show the bright saturated colors I see with my own eyes. And that’s with any of the cameras. I stuck with the iPhone output because it actually looked the best of the three cameras with less effort. But there’s still tremendous room for improvement.