Skip to content

Commit 2e7ab09

Browse files
committed
Updated to use pixel_order
1 parent fdd65a2 commit 2e7ab09

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

examples/neopixel_simpletest.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
# The number of NeoPixels
1111
num_pixels = 10
1212

13-
# The number of colors in each pixel: 3 for RGB, 4 for RGBW (RGB plus white)
14-
BPP = 3
13+
# The order of the pixel colors - RGB or GRB. Some NeoPixels have red and green reversed!
14+
# For RGBW NeoPixels, simply change the ORDER to RGBW or GRBW.
15+
ORDER = neopixel.GRB
1516

16-
pixels = neopixel.NeoPixel(pixel_pin, num_pixels, bpp=BPP, brightness=0.3, auto_write=False)
17+
pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.3, auto_write=False,
18+
pixel_order=ORDER)
1719

1820

1921
def format_tuple(r, g, b):
20-
if BPP == 3:
22+
if ORDER == neopixel.RGB or ORDER == neopixel.GRB:
2123
return r, g, b
2224
return r, g, b, 0
2325

0 commit comments

Comments
 (0)