Was not sure where to post for help
1. The program is working fine.
2. My problem is I cannot figure out the proper syntax / code to put a variable inside an html table /box
3. Current code displays the htmlvar(curr) and htmlvar(tf) as text but not the actual variables.
Any help would be much appreciated.
Thanks
joe
SEE CODE Below
memclear
SERIALPRINTLN "restart page"
cls
let tf = 0
let curr = 0
let setp = 31
let stat = On
wprint "<head>"
wprint "<meta http-equiv='refresh'content='10;URL=/input?'>"
wprint "</head>"
wprint "<table bgcolor='lightblue' border='1' cellpadding='5'>"
wprint "<th><h1>WiFi Cooling Thermostat !</h1></th>"
wprint "<th</th></table><br>"
wprint "<div><table bgcolor='Yellow' border='1' cellpadding='5'>"
wprint "<tr><th>Sensor</th><th>TempC</th><th>TempF</th></tr>"
wprint "<tr><td>DS18B20P</td>"
wprint "<td bgcolor='cyan'>"
wprint "htmlvar(curr)</td>"
wprint "<td bgcolor='lightgreen'>wprint htmlvar(tf)</td></tr>"
'wprint "<tr><td>DS18B20P</td><td bgcolor='cyan'>wprint htmlvar(curr)</td><td bgcolor='lightgreen'>wprint htmlvar(tf)</td></tr>"
Button "Set Temperature" [setpt]
textbox setp
wprint "<br><br>"
wprint "Current Temp - Celsius= "
wprint "<br><br>"
wprint "Current Temp - Fahrenheit= "
wprint htmlvar(tf)
wprint "<br><br><br><br>"
wprint "COOLING FAN="
wprint htmlvar(stat)
wprint "<br><br><br>"
Button "Exit" [quit]
wprint "<br>"
timer 4000, [refresh]
wprint "<br>"
wait
[on2]
po D2 1
SERIALPRINTLN "GPIO 2 ON"
let stat = "On"
Wait
[off2]
po D2 0
SERIALPRINTLN "GPIO 2 OFF"
let stat = "Off"
Wait
[setpt]
wprint "<head>"
wprint "<meta http-equiv='refresh' content='10;URL=/input?'>"
wprint "</head>"
Wait
[refresh]
temp 0 curr ' read current temperature for device 0 db1820
tf = curr * 9
tf = tf / 5
tf = tf + 32
SERIALPRINTLN curr
SERIALPRINTLN tf
if curr > setp then goto [on2] else goto [off2] 'TURN FAN ON IF CURRENT TEMP IS GREATER THEN SETP
Wait
[quit]
timer 0
wprint "<a href='/'>Menu</a>"
end