Skip to content

Commit 91a5e4e

Browse files
committed
Fixes for latest _pixelbuf
1 parent ea8ded6 commit 91a5e4e

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

neopixel.py

+3-16
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,7 @@ def __init__(self, pin, n, *, bpp=3, brightness=1.0, auto_write=True, pixel_orde
112112
order[pixel_order] = order_chars[char_no]
113113
pixel_order = ''.join(order)
114114

115-
super().__init__(n, bytearray(self.n * bpp),
116-
brightness=brightness,
117-
rawbuf=bytearray(self.n * bpp),
118-
byteorder=pixel_order,
119-
auto_write=auto_write)
115+
super().__init__(n, brightness=brightness, byteorder=pixel_order, auto_write=auto_write)
120116

121117
self.pin = digitalio.DigitalInOut(pin)
122118
self.pin.direction = digitalio.Direction.OUTPUT
@@ -142,14 +138,5 @@ def write(self):
142138
Use ``show`` instead. It matches Micro:Bit and Arduino APIs."""
143139
self.show()
144140

145-
def show(self):
146-
"""Shows the new colors on the pixels themselves if they haven't already
147-
been autowritten.
148-
149-
The colors may or may not be showing after this function returns because
150-
it may be done asynchronously."""
151-
neopixel_write(self.pin, self.buf)
152-
153-
def fill(self, color):
154-
"""Colors all pixels the given ***color***."""
155-
_pixelbuf.fill(self, color)
141+
def _transmit(self, buffer):
142+
neopixel_write(self.pin, buffer)

0 commit comments

Comments
 (0)