It is essential that you press the exit button to terminate the program. Otherwise the timer is left running and then it is difficult to access the ESP8266 Basic Interpreter windows
memclear
timer 1000 [branch]
cls
wprint "<head>"
wprint "<meta http-equiv='refresh' content='5'>"
wprint "</head>"
gosub readdata
wprint "<table border='1'>"
wprint "<tr>"
wprint "<td>"
wprint "ADC"
wprint "</td>"
wprint "<td>"
wprint htmlvar(ADCin)
wprint "</td>"
wprint "</tr>"
wprint "<tr>"
wprint "<td>"
wprint "GPIO0"
wprint "</td>"
wprint "<td>"
wprint htmlvar(PIO0)
wprint "</td>"
wprint "</tr>"
wprint "<tr>"
wprint "<td>"
wprint "GPIO2"
wprint "</td>"
wprint "<td>"
wprint htmlvar(PIO2)
wprint "</td>"
wprint "</tr>"
wprint "<tr>"
wprint "</table>"
wprint <p>
button Exit [TestExit]
wait
[TestExit]
timer 0
end
[branch]
gosub readdata
wait
readdata
ai ADCin 'update variable with latest analog in
pi 0 PIO0
pi 2 PIO2
return