|
本帖最后由 chenzhaohui 于 2020-6-16 18:02 编辑
同样一段程序,在esp8266板卡2.5.0版本没问题,高于这个版本,就会重启,2.5.0与高版本有什么要注意的吗?
#include <NTPClient.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
const char *ssid = "xxx";
const char *password = "xxx";
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, "stdtime.gov.hk", 8*3600, 10*60*1000);
void setup(){
Serial.begin(115200);
WiFi.begin(ssid, password);
while ( WiFi.status() != WL_CONNECTED ) {
delay ( 500 );
Serial.print ( "." );
ESP.wdtFeed();
}
timeClient.begin();
}
String abc;
void loop() {
timeClient.update();
Serial.println(timeClient.getFormattedTime());
Serial.println(timeClient.getOriginalTime());
abc=timeClient.getOriginalTime();
Serial.println(String()+"abc:"+abc);
delay(1000);
}
|
|