Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use PixelBuf to back the pixels buffer in the neopixel submodule.
This adds compatibility with the adafruit_led_animation library, in particular it adds:
__getitem__
and slices support. It sends pixel data all at once, but in chunks to avoid IO errors. It no longer sends pixel data as they are changed. Also switches the pixel order constants to strings, to match the neopixel API.The size of the chunks is an estimate, I'm not sure if there are devices with seesaw builds that require a smaller size. Sending the whole strip of pixels at once can be quite slow with long pixel strips. This is the only way to do it with PixelBuf however, since the only access to the buffer is in
_transmit
.Comparatively the original code would send pixels as they are modified, and only send a "show" command on show to the seesaw, basically putting the double buffer on the seesaw. This can actually be beneficial for some specific types of animations, but it's a tradeoff.
An alternative to this PR would be to add the PixelBuf API in python to the current implementation to keep the double buffering (and also optimize slices with chunks), for which the python version of PixelBuf might help.
I did some tests on Feather RP2040 with a Neokey 1x4 and a SAMD09 and ATTiny8x7 seesaw breakouts with a 30 pixels strip, no RGBW device. Additional tests on other seesaw boards would be nice.
Here is the test code:
This should fix #105