Post about your Basic project here

Moderator: Mmiscool

User avatar
By joeman2116
#48953
Mmiscool wrote:There was a major problem with the 3.0 alpha 5.

Just put out a new build

Here is a simple example that dose not use a button to set the temperature. Just type a new value in the target temp field and click off of it or hit tab.

Code: Select allmemclear
SERIALPRINTLN "restart page"
cls

curr = 0
setp = 30
stat

Print "ESP8266 WiFi Thermostat "
print "Target temp="
textbox setp
print "CurrTemp="
textbox curr
print "Heater="
textbox stat
print
button "Exit", [quit]
timer 5000, [refresh]
wait


[refresh]
curr = temp(0)
SERIALPRINTLN curr
if curr < setp then
  io(po,16,1)
  stat = "On"
else
  io(po,16,0)
  stat = "Off"
end if
Wait

[quit]
timer 0
wprint "<a href='/'>Menu</a>"
end



Thanks for the info. Will give it a run....
Your work is much appreciated.
Joe
User avatar
By Mmiscool
#48954 I have not been able to figure out why things wont change color.

I have right clicked and did view source on the output page from esp basic. copied the source and placed it in an html file only to find that when i open the html file it worked. scratches head.
User avatar
By joeman2116
#48958
Mmiscool wrote:I have not been able to figure out why things wont change color.

I have right clicked and did view source on the output page from esp basic. copied the source and placed it in an html file only to find that when i open the html file it worked. scratches head.


I flashed my esp with your v3 -A6

Code works fine as far as temp and setting temp, refresh is also ok..

I will try and add some simple html to see if any works.

Thanks
Joe
User avatar
By joeman2116
#48960 Mmiscool,

In the code below:

I tried various html code formats and still nothing with html is working correctly
With " " and ' ' and | | as formats but no go - no errors
Temp works, set temp works - just nothing to do with html styling appears....
Got me fooled.... I am sure once once you get one part of html working the rest will as well...

Joe...


memclear
SERIALPRINTLN "restart page"
cls

curr = 0
setp = 30
stat

wprint "<head>"
wprint "<meta http-equiv='refresh'content='5;URL=/input?'>"
wprint "</head>"
wprint "<body bgcolor='lightgrey'>"
wprint "</body>"

wprint '<table align='center' width='320' bgcolor='lightblue' border='6' cellpadding='5'>'
wprint '<th><h2><b>WiFi Eco Thermostat</h2></b></th>'
wprint '<th</th></table><br>'


wprint '<HTML>'
WPRINT '<HEAD>'
WPRINT '<ESP8266 WiFi Thermostat>'

wprint '<Target temp=>'
WPRINT '</HEAD>'
wprint '</HTML>'

textbox setp
print "CurrTemp="
textbox curr
print "Heater="
textbox stat
print
button "Exit", [quit]
timer 5000, [refresh]
wait
[refresh]
curr = temp(0)
SERIALPRINTLN curr
if curr < setp then
io(po,D2,1)
stat = "On"
else
io(po,D2,0)
stat = "Off"
end if
Wait

[quit]
timer 0
wprint "<a href='/'>Menu</a>"
end
You do not have the required permissions to view the files attached to this post.