-
Notifications
You must be signed in to change notification settings - Fork 38
Add support for Pixelbuf #48
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
I tested the pixelbuf branch successfully on Itsy Bitsy M0 CP version 5.3.0 with this code: import time
import random
import board
import adafruit_dotstar as dotstar
# Using a DotStar Digital LED Strip with 30 LEDs connected to hardware SPI
dots = dotstar.DotStar(board.SCK, board.MOSI, 30, brightness=0.2)
# HELPERS
# a random color 0 -> 224
def random_color():
return random.randrange(0, 7) * 32
# MAIN LOOP
n_dots = len(dots)
while True:
# Fill each dot with a random color
for dot in range(n_dots):
dots[dot] = (random_color(), random_color(), random_color())
for dot in range(n_dots):
dots[dot] = (0,0,0) Seems to work correctly as far as I can tell and blazing fast compared to current library. |
Is it worth cleaning up the comment in the example code (https://github.com/adafruit/Adafruit_CircuitPython_DotStar/blob/master/examples/dotstar_simpletest.py#L17-L19) on the back of this? It should read |
@FoamyGuy If you could, it would be good to test the library with the same code, but with a version of CP < 5. This way you are also testing the |
@dunkmann00 On CP version 4.1.2 with the external pixelbuf library in the lib directory I get this error:
On CP Version 5.0.0 the example code does work successfully |
@dunkmann00 Actually the previous error was a result of using the new dotstar branch along with a newer pixelbuf library on the Itsy Bitsy M0 with CP 4.1.2. Using the new dotstar branch along with the pixelbuf library from the 4.x bundle it does work successfully (albeit noticeably a tad slower than the 5.X ones imo) |
@FoamyGuy Thanks for checking that out! And you are correct that it is slower. The python version of pixelbuf, being python, isn't as performant. So if someone is currently using CP 4.x and looking for a performance boost, they would need to upgrade to CP 5. |
…BGR, make brightness property doc clearer
@dunkmann00 Thank you for picking this up! Please take a look at the PR submitted to your PR by @rhooper as it resolves a couple of issues we found with your submission. |
@dunkmann00 this looks great! Thanks for finishing it up! I sent a small PR (@kattni already mentioned it). I really should have checked for new PRs before I re-did my work... I even totally forgot about my old fork and branch, because I couldn't find it locally (It must be on my laptop). |
@dunkmann00 @FoamyGuy Were the updates to |
@FoamyGuy will be testing the |
Tested with RasPi 3 B+. I had to install these:
After doing so the |
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.
Looks great! Thanks all!
Updating https://github.com/adafruit/Adafruit_CircuitPython_DotStar to 2.0.0 from 1.6.1: > Merge pull request adafruit/Adafruit_CircuitPython_DotStar#48 from dunkmann00/pixelbuf
This adds support for
pixelbuf
which addresses #25.I tested this with the DotStar on my itsybitsy and everything seemed to work okay. If someone else could give it a look with multiple DotStars that would be great.
This also fixes #37 and fixes #41.