You do not need to explicitly call the serialEvent() function. It is called automatically at the end of the loop() function.
It looks like the parsujpolecenia() function is never being called. Could this be because the serialEvent() function is being called twice by the loop() function which causes the Serial buffer to be empty when your explicit call to the function occurs
As an experiment, rename the serialEvent() function to prevent it being called at the end of loop()
The last parameter in the cmd=1667,64,25,2400,1 command calls the pan() function for “0” or timelaps() for “1”.
It seems that the parsecommand() and serialEvent() functions work correctly. This can be checked by setting the last parameter to “0”. These functions also worked correctly in the old version with “delay”.
I only have a problem with the use of millis(). And I asked for help in this regard , hoping to be shown and explained to me.
The minimum of your engagement should by to at least make an own attempt
to add serial printing to your code.
I don't understand this allegation. After all, for the timelaps() function, the serial port starts and shows that only one picture was taken. On the serial port, please send a command such as cmd=1667,64,25,2400,1. There should be 25 pictures taken at an interval of 2.4 sec.
The pan() function works fine, so there is no need to change or add anything.
How many times do you expect timelaps() to be called?
Once per cmd?
Once per MsecPeriod?
Once per loop?
As written, it looks like to only gets called once per command.
Typically when using millis() to schedule events, you re-write all your code to be called very frequently, and let your functions use millis() or other logic to do only the things that need doing. It is an important trick useful for doing more than one thing at (apparently) the same time. But if your code is written to do only one thing at a time, it complicates things and isn't much more useful than delay().
Aha. --- ... --- Never heard of it before. Read about it.
Aha. --- ... ---
Not sure who you mean. It is directly below my posting # 28.
Could be a reaction to my post #28.
Though I do net really understand your comment. Me saying this - in your eyes - might be just another proof that I am suffering "Dunning-Krueger"
Anyway I would appreciate if you explain in easy to understand words what you want to say with