Skip to content

Commit c752669

Browse files
committed
zero bits for trailer
Use zero bits, not ones, for the trailer, to avoid lighting up downstream pixels when the DotStar object is created with fewer pixels than are physically present in the chian. This is visible after the second update of a DotStar object that is at least 17 pixels long, when there is a greater number of physical pixels in the chain. Signed-off-by: Taylor Yu <[email protected]>
1 parent 8b1b8d1 commit c752669

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

adafruit_dotstar.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ def __init__(
127127

128128
# Four empty bytes for the header.
129129
header = bytearray(START_HEADER_SIZE)
130-
# 0xff bytes for the trailer.
131-
trailer = bytearray(b"\xff") * trailer_size
130+
# Zero bits, not ones, for the trailer, to avoid lighting up
131+
# downstream pixels, if there are more physical pixels than
132+
# the length of this object.
133+
trailer = bytearray(trailer_size)
132134

133135
super().__init__(
134136
n,

0 commit comments

Comments
 (0)