Replicating Timer on/ off delays

I am looking for help on starting. I have never used Nextion, I come from PLCs and their associated HMI software. I am looking for an easy way to send slider information to an Arduino Mega to adjust delay times. I cannot find anything to help me do this.

In a PLC terms, off button pressed, relay stays active for “x” amount of time. I need this value to adjustable but I cannot figure out how to put that value into the mega in real time.

Image is what I have in Nextion Software.

Thank you for any help. Please do not be rude. This is for a school project and my first time working with an HMI in this sense.

Hi
As a quick possible suggestion using the Nextion Library.
(There are probably better ways of doing it)
I’d send a ‘release event’ telling the Arduino that the value has changed and then get the Arduino to query the Nextion for the slider value.
Eg
Void nOPopCallback(void* ptr)
{
no.getValue(&Number); // this gets the value from the slider.
n0SliderValue = Number;

}

Hope this helps.

1 Like

Sorry about the typos :frowning:
Void n0PopCallback(void* ptr)
{
n0.getValue(&Number); // this gets the value from the slider.
n0SliderValue = Number;

}

1 Like

Thank you, this is very helpful.