Is there a way to Speed this Up? #821
Replies: 2 comments 1 reply
-
For speed testing, DO NOT put Serial.print() calls inside your speed test loop. They are extremely slow compared to what you are doing. Just capture the timing and print it outside your time capture area. Show will block until the last send is complete. Once it starts to send the current frame you requested, the method returns and sends it in the background so you can prepare the next frame while it sends it out (this Async functionality is only available on some platforms, but the RP2040 is one of them). The send protocol of 300 pixels is ~1.25us per bit, so 300 pixels * 4 bytes (RGBW) * 8 bits * 1.24us = 11,904us. Plus the 300us reset time required between sends and a little overhead to copy data, should be around 13 to 14ms. Everything else is your sketch preparing the next frame. For the non-linear intensity, this is how the LEDs work, and you can use the NeoPixelBusLg or the correct use of the NeoGamma classes to provide the "normalization" so it looks linear.
The NeoGamma class requires a template specializer and doesn't have a default one; so, this should fail the compile step. It should be.
Many examples demonstrate the correct use. Is there a reason you are using the Gamma feature outside of just using NeoPixelBusLg?
For the color order issue, use a different feature. You are using |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
This is a test program to learn how to use the Library, not my final program.
But is there a way to speed up the execution of this program on an RP2040? i.e. using Hardware SPI or something?
Beta Was this translation helpful? Give feedback.
All reactions