Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

NeoPixel RGB sequence problem
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

NeoPixel RGB sequence problem

by blakebr on Wed Apr 28, 2021 12:32 pm

Hello,

QT Py 6.2.0
neopixel.RGB gives different results if you are referencing board.NEOPIXEL or board.EXTERNAL_PIN
board.NEOPIXEL has the first two colors reversed. To get an RGB result for board.NEOPIXEL I must specify GRB.

My code below:
If I specify NUM_PIXELS as '1' I reference the onboard NeoPixel as GRB to get RGB, - otherwise the NeoPixel string RGB gets RGB on the board.SDA pin.
I have not tested this on other versions of CircuitPython.

DOTS added to show indents.
NUM_PIXELS = 1
if(NUM_PIXELS == 1): # NEOPIXEL Internal NeoPixel
. STRING = board.NEOPIXEL #
. ORDER = neopixel.GRB # Neo_1=Green, Neo_2=Red, Neo_3=Blue - R&G reversed
. BRIGHTNESS = 0.10 #
. Neo_1_Max = 150 # Green
. Neo_2_Max = 50 # Red
. Neo_3_Max = 250 # Blue
else: # SDA External NeoPixel(s)
. STRING = board.SDA #
. ORDER = neopixel.RGB # Neo_1=Red, Neo_2=Green, Neo_3=Blue - R&G normal
. BRIGHTNESS = 0.25 #
. Neo_1_Max = 250 # Red
. Neo_2_Max = 250 # Green
. Neo_3_Max = 250 # Blue

Bruce

blakebr
 
Posts: 28
Joined: Tue Apr 17, 2012 6:23 pm

Re: NeoPixel RGB sequence problem

by dastels on Wed Apr 28, 2021 1:29 pm

OK. What's the problem?

Dave

dastels
 
Posts: 6129
Joined: Tue Oct 20, 2015 3:22 pm

Re: NeoPixel RGB sequence problem

by blakebr on Wed Apr 28, 2021 1:57 pm

Dave,

When I specify ORDER = neopixel.RGB for the onboard NeoPixel LED the LEDs driven are in Green, Red, Blue order.
R lights Green, G lights Red, B lights Blue. Red and Green are reversed.
(255,0,0) lights up the Green LED not the Red as RGB specified, (0,255,0) lights up the Red LED.
To get the RGB order for the onboard NeoPixel I must specify ORDER = neopixel.GRB.

When I drive an external string of NeoPixels, the correct LEDs are lit with RGB. R lights Red, and G lights Green, B lights Blue.

Bruce

blakebr
 
Posts: 28
Joined: Tue Apr 17, 2012 6:23 pm

Re: NeoPixel RGB sequence problem

by dastels on Wed Apr 28, 2021 3:28 pm

There's no problem with that. Some "NeoPixel" devices use RGB order, some use GRB order. The onboard device is clearly a GRB device, and what you're connecting is RGB. That's why you can specify the order when you instantiate the NeoPixel object.

Dave

dastels
 
Posts: 6129
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.