Resetting Slider in Nextion - Solved #3

I am using a Nextion display. And not using the Nextion library.

It appears there is no method to programmatically reset a slider to zero position via the UART ?

Would like to know if it can be done. Thanks.

You just need to send the required value to the slider, if you want it at the start send 0, if you want it at the middle send the middle value, if you want it at the end send the value of maxval.

For example:

Serial1.print(F("h0.val=0"));
Serial1.print("\xFF\xFF\xFF");

PerryBebbington:
You just need to send the required value to the slider, if you want it at the start send 0, if you want it at the middle send the middle value, if you want it at the end send the value of maxval.

For example:

Serial1.print(F("h0.val=0"));

Serial1.print("\xFF\xFF\xFF");

Thanks. I was travelling and hence could not respond back immediately.

Will try this out when the unit reaches back after integration of the display in a housing.

Moving the slider varies the "val" but will forcing the "val" to zero move the slider back ?

Moving the slider varies the "val" but will forcing the "val" to zero move the slider back?

Correct, you can change the value of val either by moving the slider or through the serial port and the slider will go to the appropriate position for the value you change val to. Try it and play around with different values to see what happens.