Skip to content

Commit c4ffc33

Browse files
author
luoweiyuan
committed
unit: Fix Unit Puzzle driver error.
Signed-off-by: luoweiyuan <luoweiyuan@m5stack.com>
1 parent 1918d87 commit c4ffc33

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

m5stack/libs/driver/neopixel/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ def __init__(self, pin: Pin, n: int, bpp: int = 3, timing: int = 1) -> None:
4444
self.n = n
4545
self.bpp = bpp
4646
self.buf = bytearray(n * bpp)
47-
self.pin.init(pin.OUT)
47+
# Drive LOW immediately so the first bitstream call sees a clean
48+
# WS2812 reset, even if this pin was previously used as I2C SDA
49+
# (e.g. AtomS3 Lite Port A G2, Fire Port A G21) and left HIGH by pull-up.
50+
self.pin.init(pin.OUT, value=0)
4851
self.timing = (
4952
((400, 850, 800, 450) if timing else (800, 1700, 1600, 900))
5053
if isinstance(timing, int)

0 commit comments

Comments
 (0)