Moderator: Mmiscool
I must compliment you on your OUTSTANDING coding!
I just loaded it up on a nodemcu module and ran it and I am in awe!
I love to see examples like this to see how to implement various methods like html, cssid, htmlvar, etc, etc.
If you are willing it would be awesome to do a youtube video where you walk down through the code and explain what each part does so others can learn and see how POWERFUL mike's espbasic really is.
Or even just a written tutorial or anything.
It is detail like that that is missing from the doc's
Mike has given me access to the docs to add examples and detail but I would be guessing at some of what you have done in your code.
your thoughts
regards
dwight
For DST info, I use the DST value that is in the system but set its value it myself (during initial time/network setup by the user). The DST detection code will ONLY operate on the DST change day/hour. If your clock is not plugged in it will not be able to figure it out later. I started to write this but...
FWIW, the clock has been running continuously for a very long time, on power outages (it's not plugged into a UPS) it comes right up and works again. It's running an older version of ESP basic 3 V58 right now. Haven't had a chance to do much lately but hope to soon.
russ
russ
'********************************************************
'* Calibrate Analog Panel Meter Clock *
'* by Russ McIntire, 9/9/16 *
'* D0 = Hours *
'* D1 = Minutes *
'* D2 = Seconds *
'* *
'* Set Hour, Minute, Second to calibrate panel meters *
'********************************************************
memclear
hour = 0
min = 0
sec = 0
M = " "
udptimer = 0
hourpwm = 0
minpwm = 0
secpwm = 0
updated = 0
updatetimer = 0
cts = time("hour:min:sec")
uvsr = "Running..."
'GUI setup
cls
wprint |<HTML>|
wprint |<HEAD>|
wprint |<style> h1{text-shadow: 2px 2px 5px blue} </style>|
wprint |<h1>Analog Clock Setup</h1>|
wprint |</HEAD>|
wprint "Calibration"
wprint "<br><br>"
textbox hour
cssid htmlid(),"position: absolute; left: 130px; display:block;width:40px"
wprint "Hour(0-12,12=0): "
wprint "<br>"
textbox min
cssid htmlid(),"position: absolute; left: 130px; display:block;width:40px"
wprint "Minute(0-59):"
wprint "<br>"
textbox sec
cssid htmlid(),"position: absolute; left: 130px; display:block;width:40px"
wprint "Second(0-59):"
wprint "<br><br>"
button "Show Time", [show_time]
wprint "<br><br>"
wprint "<br> <br>"
button "Reboot Clock", [reboot_clock]
wprint "<br><br>"
wprint htmlvar(uvsr)
wprint "<br><br>"
timer 5000, [show_time]
wait
end
[show_time]
'Get time values from NTP server
'hour = val(time("hour"))
'min = val(time("min"))
'sec = val(time("sec"))