最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

25元不到 ESP8266 自制NTP時鐘+天氣顯示

2023-08-25 16:25 作者:羅叔雲(yún)_LZY  | 我要投稿

關(guān)于定時息屏部分代碼有問題,可以把loop全部替換成如下內(nèi)容


void loop()

{

timeClient.update();

get_time_1();


if(currentHour>=23||currentHour<6)//設(shè)置23點到次日6點不顯示

{

u8g2.clearBuffer(); //清屏

u8g2.sendBuffer(); // transfer internal memory to the display


WiFi.mode( WIFI_OFF );

WiFi.forceSleepBegin();

Serial.println("WiFi is down");

delay(20000*3);


WiFi.forceSleepWake();

delay(1);

// Bring up the WiFi connection

WiFi.mode(WIFI_STA);

WiFi.begin(ssid, password);//wifi連接


// Wait until the connection has been confirmed before continuing

while (WiFi.status() != WL_CONNECTED)

{

delay(500);

Serial.print(".");

}

timeClient.update();

get_time_1();

Serial.println("OFF_OLED");

delay(1);

}

else

{

if(n==1)//獲取時間

{

get_date();

get_time_1();

n=0;

}

if(jj==1)//獲取天氣

{

get_weather();

timeClient.update();

jj=0;

}

//oled*************************************************

u8g2.clearBuffer(); //清屏


oled_show_weather();

oled_show_time();

oled_show_line();


u8g2.sendBuffer(); // transfer internal memory to the display

Serial.println("ON_OLED");

//led();//led閃爍

}

}


25元不到 ESP8266 自制NTP時鐘+天氣顯示的評論 (共 條)

分享到微博請遵守國家法律
大宁县| 自治县| 大城县| 贵定县| 自治县| 新邵县| 滕州市| 保靖县| 修水县| 原阳县| 贵州省| 攀枝花市| 佳木斯市| 莒南县| 栖霞市| 雅安市| 南通市| 观塘区| 天柱县| 方正县| 个旧市| 普陀区| 岑巩县| 石阡县| 曲周县| 镇雄县| 原平市| 阳信县| 洛浦县| 肇源县| 湖北省| 延安市| 土默特右旗| 湘阴县| 吉木萨尔县| 乌审旗| 云和县| 武穴市| 林周县| 隆德县| 武清区|