Last active
July 29, 2017 15:37
-
-
Save Ryanhu1015/fb14b3fa1b1820ea1ebac89c9be889d7 to your computer and use it in GitHub Desktop.
NTPserver_alternative
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//there are three option | |
char *ntpServerName = "tick.stdtime.gov.tw"; | |
char *ntpServerName2 = "clock.stdtime.gov.tw"; | |
char *ntpServerName3 = "time.stdtime.gov.tw"; | |
void setup() | |
{ | |
//.skip this part | |
//. | |
//. | |
server.on("/NTP", []() | |
{ | |
ntpServer(ntpServerName); | |
hours = ((epoch % 86400L) / 3600) + 8; | |
minutes = (epoch % 3600) / 60; | |
seconds = epoch % 60; | |
show(); | |
server.send(1000, "text/html", page); | |
}); | |
server.on("/NTP2", []() | |
{ | |
ntpServer(ntpServerName2); | |
hours = ((epoch % 86400L) / 3600) + 8; | |
minutes = (epoch % 3600) / 60; | |
seconds = epoch % 60; | |
show(); | |
server.send(1000, "text/html", page); | |
}); | |
server.on("/NTP3", []() | |
{ | |
ntpServer(ntpServerName3); | |
hours = ((epoch % 86400L) / 3600) + 8; | |
minutes = (epoch % 3600) / 60; | |
seconds = epoch % 60; | |
show(); | |
server.send(1000, "text/html", page); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment