Redboard Turbo RGB LED Circuitpython example

Hello,

I have tried unsuccessfully to get the RGB LED working on my Redboard Turbo in Circuitpython.

Can someone provide sample code or point me to a sample?

Thanks,

Jason

Can you confirm if the Turbo pops up as a USB device?

It pops up as a USB drive. “CIRCUITPY”

Jason

Try and see if this guide helps: https://circuitpython.readthedocs.io/pr … en/latest/

Thank you! I will give it a go.

I get the following error:

Traceback (most recent call last):

File “code.py”, line 5, in

AttributeError: ‘module’ object has no attribute ‘NEOPIXEL’

When trying the first example:

import board

import neopixel

pixels = neopixel.NeoPixel(board.NEOPIXEL, 1)

pixels[0] = (10, 0, 0)

I have neopixel.mpy in D:\CIRCUITPY\lib

Perhaps I am not installing the neopixel library correctly? How do you install libraries on the Redboard Turbo?

In the adafruit lib examples, I found the following. However, I don’t know how to reference the pin that the Neopixel is connected to. board.44 does not work, says invalid syntax.

This example shows how to create a single pixel with a specific color channel

order and blink it.

Most NeoPixels = neopixel.GRB or neopixel.GRBW

The 8mm Diffused NeoPixel (PID 1734) = neopixel.RGB

import time

import board

import neopixel

Configure the setup

PIXEL_PIN = board.D1 # pin that the NeoPixel is connected to

ORDER = neopixel.RGB # pixel color channel order

COLOR = (100, 50, 150) # color to blink

CLEAR = (0, 0, 0) # clear (or second color)

DELAY = 0.25 # blink rate in seconds

Create the NeoPixel object

pixel = neopixel.NeoPixel(PIXEL_PIN, 1, pixel_order=ORDER)

Loop forever and blink the color

while True:

pixel[0] = COLOR

time.sleep(DELAY)

pixel[0] = CLEAR

time.sleep(DELAY)

Can you provide pictures of the error you’re seeing, as well as your code?

I apologize for the lack of documentation for using CircuitPython with the Turbo. CircuitPython is developed by Adafruit and we refer to mainly their resources. After talking with internal teams we can try a few things to see if we can’t get it running.

Instead of using PIXEL_PIN, try using board.NEOPIXEL:

# This example shows how to create a single pixel with a specific color channel
# order and blink it.
# Most NeoPixels = neopixel.GRB or neopixel.GRBW
# The 8mm Diffused NeoPixel (PID 1734) = neopixel.RGB
import time
import board
import neopixel

# Configure the setup
ORDER = neopixel.RGB # pixel color channel order
COLOR = (100, 50, 150) # color to blink
CLEAR = (0, 0, 0) # clear (or second color)
DELAY = 0.25 # blink rate in seconds

# Create the NeoPixel object
pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, pixel_order=ORDER)

# Loop forever and blink the color
while True:
pixel[0] = COLOR
time.sleep(DELAY)
pixel[0] = CLEAR
time.sleep(DELAY)

That generates the following error:

Traceback (most recent call last):

File “code.py”, line 16, in

AttributeError: ‘module’ object has no attribute ‘NEOPIXEL’

Do you have a “lib” folder in your CIRCUITPY storage?

We have some people from our internal team looking into this issue. I apologize for the inconvenience.

Yes, I have a lib folder with the neopixel library in it.

I browsed around the src code and found that the pin is defined as “RGB_LED” in the RedBoard Turbo, vs “NEOPIXEL” for the Adafruit M0. I changed “NEOPIXEL” to “RGB_LED” in the CircuitPython example and now it works!