Hello.
Please help me with “EVERY_N_MILLISECONDS ()” I do not have enough knowledge to understand what I’m wrong.
The task will get rid of the delay ();
Thank you.
As the code is written, you are calling modx0 and changing all of the LEDs to orange. Then immediately, without any delay, calling modx1 and changing the LEDs again etc.
This is because all three animations are called immediately after each other, calling all three every 20 ms.
Look at the demo reel 100 example and replace the patterns with yours. And then call a pattern every 20 ms and at the same time update the pattern number so that next time it calls the next pattern.
@Jeremy_Spencer Hello, Jeremy Spencer.
Thank you very much for choosing to help!
My fault. I do not correctly formulated what I need.
I do not need a delay in «void loop ()».
I need to organize the delay within the «void modx0 ()»
And from there to remove delay (20);
That is «i = i + 1" through “EVERY_N_MILLISECONDS ()”
Excuse me if I do not write competently in English.
Automatic translation via translate.google.
Thanks again.
Alexander.
@Alex_Boroda , no trouble, I understood the problem before. Try working from the demo reel 100 example. Good luck
Hi @Alex_Boroda , did you make it work?
@Jeremy_Spencer Hello, Jeremy Spencer.
Thank you trying to help me.
I tried that – not working.
Maybe I’m the fool ( https://gist.github.com/Alex-Boroda/e24d06248ebe3697fcefef6b6d86f669#file-does-not-work
@Alex_Boroda I’ve added a comment with some code which might do what you want, but shows you how I use non-blocking loops. It compiles but I haven’t tried it with any leds
Hello, Jeremy Spencer.
I have corrected
void loop ()
{
// Call the current pattern function once, updating the ‘leds’ array
gPatternsgCurrentPatternNumber;
on
void loop ()
{GPatterns [gCurrentPatternNumber] ();
The code is compiled.
Filled. Flashing only the first pixel.
Append output to Serial.print that would understand what is happening.
Switching between Pattern runs.
But really only the first pixel is lit and flashing (Orange Green Red)
Jeremy Spencer. , I’m not comfortable in front of you. Thank you for spending your time on me.