I am using the web based servo code as starting point for my app.
My code gets the slider position and when user clicks a “write” button on screen, the value is transferred from ESP32 to my host over serial uart. This works.
When the user clicks “read” the ESP32 gets the last value from the host via serial uart and updates “valueString”.
However, the slider position does not get updated on screen until I leave and return to the url.
For the life of me I can not figure out how , in code, to get the slider to update with this new value. The Ajax code in RND example for servo will update the “position” text automatically ok but I need a method to move the slider at the point I get new value. I tried html meta page refresh every 3 seconds but this kept looping last action (ie. If I last pressed “read” button then the read function kept repeating every page refresh.
I can see you can set a specific element value using getDocument… but this seems to only work in a script function and I could not call the script function outside the body of html code where I processed serial data.
Its probably very simple but I am a novice to html coding and unsure of the correct syntax,
Thanks for any help