Actually the buttons are “fake” buttons, touch insensitive, hidden.
I use them to avoid a cyclopic function with a lot of conditional jumps(if).
To be clearer, button’s name are func1, func2 etc.
I only simulate the click (click func1,1).
I have to respect a certain trigger coming from arduino serial port
i can afford a certain delay(async), between trigger from arduino and reaction in nextion (the startin of the function, that is, the code in the event) but not too out of synch.
I’s impossible to obtain a PERFECT synch, but what i want is
something not so “delayed” from trigger.
I decided to write in nextion 96 functions, too much for my arduino sRam, wrapped as 96 touch events.
This way all the weight of coding is in nextion, that have much more disponible sRam.
Your suggestion is good, but, if i ain’t misunderstood, at the end, i have to use 96 “if” blocks, that is
something delaying too much the response.
Originally i made it all in ONE code window(96 if blocks), but the delay qas too much.
So i “hacked”, using 96 separated functions, disguised as 96buttons event handlers.
So, async is bearable, but now i have the problem that, for minimal change that affects all “conditional buttons”, i have to write the change 96 times in 96 different code windows.