Skip to content

Commit

Permalink
zero bits for trailer
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
tlyu committed Jan 23, 2023
1 parent 8b1b8d1 commit c752669
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions adafruit_dotstar.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ def __init__(

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

super().__init__(
n,
Expand Down

0 comments on commit c752669

Please sign in to comment.