Skip to content

Commit b90fd40

Browse files
author
caternuson
committed
removed dict
1 parent faa40b3 commit b90fd40

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

neopixel.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,10 @@
3737
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel.git"
3838

3939
# Pixel color order constants
40-
RGB = 0
41-
GRB = 1
42-
RGBW = 2
43-
GRBW = 3
44-
45-
# Pixel color order
46-
PIXEL_ORDER = {
47-
RGB: (0, 1, 2),
48-
GRB: (1, 0, 2),
49-
RGBW: (0, 1, 2, 3),
50-
GRBW: (1, 0, 2, 3),
51-
}
40+
RGB = (0, 1, 2)
41+
GRB = (1, 0, 2)
42+
RGBW = (0, 1, 2, 3)
43+
GRBW = (1, 0, 2, 3)
5244

5345
class NeoPixel:
5446
"""
@@ -97,10 +89,10 @@ def __init__(self, pin, n, *, bpp=3, brightness=1.0, auto_write=True, pixel_orde
9789
self.n = n
9890
#self.bpp = bpp
9991
if pixel_order is None:
100-
self.ORDER = PIXEL_ORDER[GRBW]
92+
self.ORDER = GRBW
10193
self.bpp = bpp
10294
else:
103-
self.ORDER = PIXEL_ORDER[pixel_order]
95+
self.ORDER = pixel_order
10496
self.bpp = len(self.ORDER)
10597
self.buf = bytearray(n * bpp)
10698
# Set auto_write to False temporarily so brightness setter does _not_

0 commit comments

Comments
 (0)