Newbie to PB and to C++ in general. I’ve written a couple of patterns but stuck on figuring out how to pause a moving pattern after a fixed number of frames are rendered. I want to pause for a few seconds after every 16 frames are rendered.
I’ve read a couple of posts about “accumulating delta” but after trying for a long time just not getting there. I guess I’m having trouble wrapping my head around the “2-cycle engine” still. I appreciate help on this!
I may be not asking the right question, since I think very many redundant frames are sent before the pattern actually moves. To be very specific, I want to pause the Christmas Candy Cane pattern (in the “get patterns” PB patterns database) for a couple of seconds after the white blocks move to the position the red blocks once occupied. In other words, when a block moves one block distance.
I can bypass to the end of the render function for a couple of seconds, but sadly the string goes blank if nothing is rendered in the render function, rather than leaving alone what’s already been sent to the LED strip. This engine just likes to keep going and going without any way to pause it.
Pixelblaze currently renders continuously. At some point I think an API to skip animation frames would make sense. This comes up infrequently and it hasn’t become top of list.
Right now the best ways to do something like this is to buffer what the pixels will show (like in an array), only updating the pixels when you want the animation to change, or basing the animation on some variable that you control and intermittently update as you want the animation to progress. What you have above is an example of that.
Thank you! A series of arrays called up in a sequence and at various time intervals for rendering is a perfect idea for someone, like me, not wanting to go crazy trying to do something more elegant. I’m surprised this doesn’t come up more often, but I sure would benefit from a way to skip rendering that maintains the data last rendered to the pixels.
It’s likely because I am new to PB that all the time I spent due to a lack of a “pause” ability was a bit nerve-racking, but I’m getting to know the creature and liking it overall, a lot. I’ve programmed PIC microcontrollers (using PIC BasicPro --yeah, I’m that old) to do many LED strip patterns, having the control, of course, to send data out to the pixels if, when, and how many times I want to send it out. So much is new to me with the PB, but I’m getting there. I very much like the idea that I don’t have to cable to the PB to program and use it. That sold it for me. I also very much like that after a repower it remains in the state it was left in before power down, including the playlist. And, the web interface is a great thing! All this means, once I am done, anyone on the network can use it to select whatever patterns are in the list.
If it wasn’t for me asking web AI for programmable pixel controllers, I may never have found the PixelBlaze. The list is small.