-
Hi Michael, first let me thank you for the awesome library, it is finally a lib which does not crash after some hours of operation on my microcontrollers. I used the adafruit "original" lib for running animations on NodeMCU / Wemos D1 controllers but found out that they tend to reset after some time when under heavy load, like for updating 200 LEDs every 20ms. So the NeoPixelBus is stable to a point where it does work reliably without crashes. But. I found out that designing a loop which updates every pixel individually with the built-in methods is painstakingly slow, up to a point where it is not usable for my animations anymore. I have a setup with 250 LEDs which I want to update, and assigning new values with a loop using the RrbColor constructor like this slows down the whole thing that i have update frequencies at approx. 5 Hz, which does not look smooth anymore: I was at a point that I wanted to revert back to the adafruit library but was annoyed by the resets, and just about throwing it all out and retire everything. I was looking at the source of your library and saw that you're using this "constructor" pattern a lot in th builtin methods, so I was wondering if I am doing something wrong with the first approach. Do you not experience this kind of slowing down? Best, Flo Video of my little nerd-lamp: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What platform are you building for? 20ms to do that work on ANY Arduino platform doesn't make sense; there is something else going on. Please provide a minimum sketch that can demonstrate the problem; since what you typed above is a fragment and can imply other issues and solutions. No need to include any timing capture unless the platform inherently supports cycle counting as I will just put in a IO PIN high/low and use a logic analyzer to capture timing. Having the object initialized at another time like your buffer suggestion, should be no different in timing if you correctly include that code into the timing equation. Actually, it should be worse, as now there is an extra copy for pixel data. Again, without a concrete example to demonstrate the problem, it is hard for me to say what a solution is; BUT constructor initialization is not inherently inefficient. |
Beta Was this translation helpful? Give feedback.
What platform are you building for? 20ms to do that work on ANY Arduino platform doesn't make sense; there is something else going on.
Please provide a minimum sketch that can demonstrate the problem; since what you typed above is a fragment and can imply other issues and solutions. No need to include any timing capture unless the platform inherently supports cycle counting as I will just put in a IO PIN high/low and use a logic analyzer to capture timing.
Having the object initialized at another time like your buffer suggestion, should be no different in timing if you correctly include that code into the timing equation. Actually, it should be worse, as now there is an extra copy for pix…