@Art
In my case, my clock does not keep track of the date or year.Unless you have a calendar you’d still want the data table anyway.
Any time you want to add or subtract time you need a calendar.
If the clock retrieves UTC time as 00:01 1st Jan 2016, and has to subtract one hour.
It has to know right down to days in month, leap years, the whole lot.
I only use the Day of Week, Month and Date to determine if DST is or is not in effect.
My ESP module gives me those three items along with the HH:MM:SS and my algorithm then determines whether or not I need to add 1 hour to the provided STD time. After that I don't bother with anything other than HH:MM:SS.
My code above seems to be working good so far and I did test for DST/STD crossing in both directions and it seems to work.
@Dave
Thanks for sharing your code, I'll take a look at it.
So far my module running ESPbasic has been running solid with this code loaded in the ESP module...
If you want to see the code running on the PIC in the clock just search the forum for "nixie".'================================================= ==========
'--- This is the code running on the ESP8266-01 module ---
'================================================= ==========
'''memclear
'''cls
'''timesetup(-7,0)
'''baudrate 9600
'''serialtimeout 2000
'''delay 1000
'''button "Exit" [Exit]
'''timer 100 [PicSer]
'''wait
''''
'''[PicSer]
'''serialflush
'''input picin
'''picin = mid(picin,1,5)
'''if picin == "Time?" then gosub [gettime]
'''wait
''''
'''[gettime]
'''bla = time()
'''dy = mid(bla,1,3) 'dow
'''mh = mid(bla,5,3) 'month
'''dd = mid(bla,9,2) 'date
'''hh = mid(bla,12,2) 'hour
'''mm = mid(bla,15,2) 'min
'''ss = mid(bla,18,2) 'sec
'''yr = mid(bla,21,4) 'year
''''
'''if dy == "Sun" then dow = "1/"
'''if dy == "Mon" then dow = "2/"
'''if dy == "Tue" then dow = "3/"
'''if dy == "Wed" then dow = "4/"
'''if dy == "Thu" then dow = "5/"
'''if dy == "Fri" then dow = "6/"
'''if dy == "Sat" then dow = "7/"
''''
'''if mh == "Jan" then mth = "01/"
'''if mh == "Feb" then mth = "02/"
'''if mh == "Mar" then mth = "03/"
'''if mh == "Apr" then mth = "04/"
'''if mh == "May" then mth = "05/"
'''if mh == "Jun" then mth = "06/"
'''if mh == "Jul" then mth = "07/"
'''if mh == "Aug" then mth = "08/"
'''if mh == "Sep" then mth = "09/"
'''if mh == "Oct" then mth = "10/"
'''if mh == "Nov" then mth = "11/"
'''if mh == "Dec" then mth = "12/"
''''
'''picout = dow & mth
'''picout = picout & dd
'''picout = picout & "/"
'''picout = picout & hh
'''picout = picout & mm
'''picout = picout & ss
''''
'''serialprintln picout
'''return
''''
'''[Exit]
'''end
I wonder if you were having problems with a certain version of the ESPbasic OS. Mike did seem to have a couple of versions that were a bit unreliable.
My ESP module is currently running Version 1.67 of the OS. I think he is up over 1.8x now and I think it is working pretty well also.
I think the problems were in the 1.7x region of his revisions. (not exact)
The ESPbasic is based (I believe) on the arduion IDE and the arduino/ESP foundation so if you are competent at the arduino C-like language then that is probably a good way to go.
I just like the built in IDE of the ESPbasic and it's (for me) easy to understand and no external IDE required.
thanks all!
Bookmarks