-
Notifications
You must be signed in to change notification settings - Fork 38
zero bits for trailer #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 <code@argon.blue>
See https://forums.adafruit.com/viewtopic.php?t=192301 for an example of confusing behavior experienced by a user due to this bug. I outlined the fix in the thread, but only recently acquired a DotStar strip to test with. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks good to me. I don't have any prior experience or knowledge of the details of the protocol that drives dotstars, but I did read through the forum thread and the blogpost mentioned in it and did see the section referencing sending the trailer zeros instead of 1's. The change here does appear to me to follow the behavior put forth by that resource.
I tested the change successfully using the reproducer code from the forums:
import board, adafruit_dotstar as dotstar, time
n = 17
dots = dotstar.DotStar(board.SCK, board.MOSI, n, brightness=0.2)
for i in range(dots.n):
dots[i] = (0x66, 0x33, 0x99, ) # Rebecca Purple
time.sleep(1)
dots.deinit()
print('done...')
I did reproduce the issue mentioned, and verified that the changed version resolves it, leaving no extra LEDs on after it deinits.
Thank you @tlyu for the fix!
Updating https://github.com/adafruit/Adafruit_CircuitPython_DotStar to 2.2.6 from 2.2.5: > Merge pull request adafruit/Adafruit_CircuitPython_DotStar#62 from tlyu/zero-trailer > Add upload url to release action > Add .venv to .gitignore > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3741 to 1.4.0 from 1.3.7: > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3741#22 from FoamyGuy/py_driver_pixelbuf > Add upload url to release action > Add .venv to .gitignore Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP9808 to 3.3.19 from 3.3.18: > Merge pull request adafruit/Adafruit_CircuitPython_MCP9808#36 from tcfranks/main > Add upload url to release action > Add .venv to .gitignore Updating https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display to 3.11.0 from 3.10.19: > Merge pull request adafruit/Adafruit_CircuitPython_RGB_Display#110 from makermelissa/master > Add upload url to release action > Add .venv to .gitignore > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_ST7735R to 1.5.10 from 1.5.9: > Merge pull request adafruit/Adafruit_CircuitPython_ST7735R#30 from makermelissa/master > Add upload url to release action > Add .venv to .gitignore Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout to 1.19.13 from 1.19.12: > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_Layout#80 from jposada202020/updating_examples Updating https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer to 2.3.0 from 2.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_HTTPServer#37 from matemaciek/main > Merge pull request adafruit/Adafruit_CircuitPython_HTTPServer#38 from matemaciek/patch-1 > Add upload url to release action Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Updated download stats for the libraries
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.