It's easy to use the NeoRGB Stemma with CircuitPython and the Adafruit_CircuitPython_NeoPixel module. This module allows you to easily write Python code for NeoPixels.
You can use this driver with any CircuitPython microcontroller board or with a computer that has GPIO and Python thanks to Adafruit_Blinka, our CircuitPython-for-Python compatibility library. You should note though that many single board computers (SBCs) don't have NeoPixel support due to the precision timing required to send data.
CircuitPython Microcontroller Wiring
Your wiring will differ depending on how many total amps will be used across all three RGB channels. Here is how you'll wire the breakout to a Feather RP2040 and single RGB LED using less than 2A total used across all three RGB channels.
- Feather 3V to NeoRGB JST PH VIN (red wire)
- Feather GND to NeoRGB JST PH GND (black wire)
- Feather pin 5 to NeoRGB JST PH SIG (white wire)
- NeoRGB RED to RGB LED red anode (pink wire)
- NeoRGB GRN to RGB LED green anode (green wire)
- NeoRGB BLU to RGB LED blue anode (blue wire)
- NeoRGB GND to RGB LED cathode (black wire)
Here is how you'll wire the breakout to a Feather RP2040 and a 12V RGB LED strip with more than 2A total used across all three RGB channels:
- Feather GND to NeoRGB JST PH GND (black wire)
- Feather pin 5 to NeoRGB JST PH SIG (white wire)
- Power supply positive pin to NeoRGB terminal block VIN (red wire)
- Power supply negative pin to NeoRGB terminal block GND (black wire)
- NeoRGB RED to RGB strip red channel (pink wire)
- NeoRGB GRN to RGB strip green channel (green wire)
- NeoRGB BLU to RGB strip blue channel (blue wire)
- NeoRGB VIN to RGB strip VIN (red wire)
Python Computer Wiring
Since there are dozens of Linux computers/boards you can use, we will show wiring for Raspberry Pi. For other platforms, please visit the guide for CircuitPython on Linux to see whether your platform is supported.
Here's the Raspberry Pi wired to the breakout and a single RGB LED with less than 2A used across all three RGB channels:
- Pi 3V to NeoRGB JST PH VIN (red wire)
- Pi GND to NeoRGB JST PH GND (black wire)
- Pi GPIO18 to NeoRGB JST PH SIG (white wire)
- NeoRGB RED to RGB LED red anode (pink wire)
- NeoRGB GRN to RGB LED green anode (green wire)
- NeoRGB BLU to RGB LED blue anode (blue wire)
- NeoRGB GND to RGB LED cathode (black wire)
On the Raspberry Pi, NeoPixels must be connected to GPIO10, GPIO12, GPIO18 or GPIO21 to work!
Here is how you'll wire the breakout to a Raspberry Pi and a 12V RGB LED strip with more than 2A total used across all three RGB channels:
- Pi GND to NeoRGB JST PH GND (black wire)
- Pi GPIO18 to NeoRGB JST PH SIG (white wire)
- Power supply positive pin to NeoRGB terminal block VIN (red wire)
- Power supply negative pin to NeoRGB terminal block GND (black wire)
- NeoRGB RED to RGB strip red channel (pink wire)
- NeoRGB GRN to RGB strip green channel (green wire)
- NeoRGB BLU to RGB strip blue channel (blue wire)
- NeoRGB VIN to RGB strip VIN (red wire)
Python Installation of NeoPixel Library
You'll need to install the Adafruit_Blinka library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready!
Once that's done, from your command line run the following command:
pip3 install adafruit-circuitpython-neopixel
If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!
CircuitPython Usage
To use with CircuitPython, you need to first install the Adafruit_CircuitPython_NeoPixel library, and its dependencies, into the lib folder on your CIRCUITPY drive. Then you need to update code.py with the example script.
Thankfully, we can do this in one go. In the example below, click the Download Project Bundle button below to download the necessary libraries and the code.py file in a zip file. Extract the contents of the zip file, and copy the entire lib folder and the code.py file to your CIRCUITPY drive.
Your CIRCUITPY/lib folder should contain the following files:
- neopixel.mpy
- adafruit_pixelbuf.mpy

Python Usage
Once you have the library pip3
installed on your computer, copy or download the following example to your computer, and run the following, replacing code.py with whatever you named the file:
python3 code.py
Example Code
If running CircuitPython: Once everything is saved to the CIRCUITPY drive, connect to the serial console to see the data printed out!
If running Python: The console output will appear wherever you are running Python.
# SPDX-FileCopyrightText: 2024 Liz Clark for Adafruit Industries # # SPDX-License-Identifier: MIT import time import board from rainbowio import colorwheel import neopixel num_pixels = 1 # pylint: disable=simplifiable-condition # check to see if its a raspberry pi if "CE0" and "CE1" in dir(board): # pi only zone pixel_pin = board.D18 # otherwise assume a microcontroller else: pixel_pin = board.D5 pixels = neopixel.NeoPixel(pixel_pin, num_pixels) color_offset = 0 while True: for i in range(num_pixels): rc_index = (i * 256 // num_pixels) + color_offset pixels[i] = colorwheel(rc_index & 255) pixels.show() color_offset += 1 time.sleep(0.01)
The code has a check to determine if you are running the code on a Raspberry Pi or not. If you are, the NeoPixel pin is set as GPIO18. Otherwise, the NeoPixel pin is set as D5. Once the loop starts, you'll see your RGB LED(s) cycle through the colors of the rainbow.
You should keep in mind when you write your own code that if you are using a strip, all of the LEDs will act as one LED from a programming perspective since they aren't individually addressable. That means some effects may look flashier or more abrupt.
Page last edited January 22, 2025
Text editor powered by tinymce.