- Sun Oct 04, 2015 11:19 am
#30479
So I am trying to simplify your code and do the same things you are trying to do.
The code below will refresh the page every 5 seconds on the browser side.
It will also run the update values branch every second and could be used for polling a sensor at an interval.
See the code below.
The wprint command is normally static so I added a function to insert a variable value that will fetch the current value of it when the page updates.
so wprint htmlvar(bla) will put make it so that when the page refreshes it will always show the latest contents of the variable.
an example of this would be:
Code: Select allbla = 5
wprint bla
bla = 10
wprint htmlvar(bla)
wait
Auto refresh code:
Code: Select allbla = 0
timer 1000 [update.Values]
wprint |<meta http-equiv="refresh" content="5; url=./input" />|
wprint htmlvar(bla)
button "this is a test" [test.1]
wait
[test.1]
wprint "test 1 was clicked"
wait
[update.Values]
bla = bla + 1
wait