Skip to content

Commit 4d12673

Browse files
committed
prepare for pixelbuf changes
1 parent 63a5340 commit 4d12673

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

neopixel.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,12 @@
3232

3333
import digitalio
3434
from neopixel_write import neopixel_write
35-
from pixelbuf import PixelBuf
35+
from pixelbuf import PixelBuf, RGB, GRB, RGBW, GRBW
3636

3737

3838
__version__ = "0.0.0-auto.0"
3939
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel.git"
4040

41-
# Pixel color order constants
42-
RGB = PixelBuf.RGB
43-
"""Red Green Blue"""
44-
GRB = PixelBuf.GRB
45-
"""Green Red Blue"""
46-
RGBW = PixelBuf.RGB
47-
"""Red Green Blue White"""
48-
GRBW = PixelBuf.GRB
49-
"""Green Red Blue White"""
5041

5142
class NeoPixel:
5243
"""
@@ -95,10 +86,11 @@ def __init__(self, pin, n, *, bpp=3, brightness=1.0, auto_write=True, pixel_orde
9586
self.n = n
9687
self.auto_write = auto_write
9788
self.bpp = bpp
89+
# TODO switch to correct byteorder if bpp specified but not pixel_order
9890
self.buf = PixelBuf(self.n, bytearray(self.n * bpp),
9991
bpp=self.bpp, brightness=brightness,
10092
rawbuf=bytearray(self.n * bpp),
101-
byteorder=pixel_order or PixelBuf.BGR)
93+
byteorder=pixel_order or GRB)
10294

10395
def deinit(self):
10496
"""Blank out the NeoPixels and release the pin."""

0 commit comments

Comments
 (0)