1515 * - Timer test and some other Arduino basic functions.
1616 *
1717 * by lxyzn from HelTec AutoMation, ChengDu, China
18- * æˆéƒ½æƒ 利特自动化科技有é™å…¬å ¸
18+ * 成都惠利特自动化科技有限公司 ¸
1919 * www.heltec.cn
2020 *
2121 * This project is also available on GitHub:
2929#include " heltec.h"
3030
3131
32- /* ********************************************* WIFI Client 注æ„编译时è¦è®¾ç½®æ¤å€?*********************************
32+ /* ********************************************* WIFI Client 注æ„编译时è¦è®¾ç½®æ¤å€?*********************************
3333 * wifi client
3434 */
3535const char * ssid = " xxxxxx" ; // replace "xxxxxx" with your WIFI's ssid
3636const char * password = " xxxxxx" ; // replace "xxxxxx" with your WIFI's password
3737
38- // WiFi&OTA 傿•°
38+ // WiFi&OTA 傿•°
3939// #define HOSTNAME "HelTec_OTA_OLED"
4040#define PASSWORD " HT.123456" // the password for OTA upgrade, can set it in any char you want
4141
42- /* *********************************************** 注æ„编译时è¦è®¾ç½®æ¤å€?*********************************
43- * 是å¦ä½¿ç”¨é™æ€IP
44- */
42+
4543#define USE_STATIC_IP false
4644#if USE_STATIC_IP
4745 IPAddress staticIP (192 ,168 ,1 ,22 );
@@ -54,13 +52,13 @@ const char* password = "xxxxxx"; //replace "xxxxxx" with your WIFI's password
5452/* ******************************************************************
5553 * OLED Arguments
5654 */
57- // #define RST_OLED 16 //OLED Resetå¼•è„šï¼Œéœ€è¦æ‰‹åЍReset,å¦åˆ™ä¸æ˜¾ç¤º
58- #define OLED_UPDATE_INTERVAL 500 // OLEDå±å¹•刷新间隔ms
59- // SSD1306 display(0x3C, 4, 15); //引脚4ï¼?5是绑定在Kit 32的主æ¿ä¸Šçš„,ä¸èƒ½åšå…¶å®ƒç”¨
55+ // #define RST_OLED 16 //OLED Resetå¼•è„šï¼Œéœ€è¦æ‰‹åЍReset,å¦åˆ™ä¸æ˜¾ç¤º
56+ #define OLED_UPDATE_INTERVAL 500 // OLEDå±å¹•刷新间隔ms
57+ // SSD1306 display(0x3C, 4, 15); //引脚4ï¼?5是绑定在Kit 32的主æ¿ä¸Šçš„,ä¸èƒ½åšå…¶å®ƒç”¨
6058
6159
6260/* *******************************************************************
63- * OTAå‡çº§é…ç½®
61+ * OTAå‡çº§é…ç½®
6462 */
6563void setupOTA ()
6664{
@@ -80,8 +78,8 @@ void setupOTA()
8078 ArduinoOTA.onStart ([]()
8179 {
8280 Heltec.display ->clear ();
83- Heltec.display ->setFont (ArialMT_Plain_10); // 设置å—体大å°
84- Heltec.display ->setTextAlignment (TEXT_ALIGN_LEFT);// 设置å—体坹齿–¹å¼
81+ Heltec.display ->setFont (ArialMT_Plain_10); // 设置å—体大å°
82+ Heltec.display ->setTextAlignment (TEXT_ALIGN_LEFT);// 设置å—体坹齿–¹å¼
8583 Heltec.display ->drawString (0 , 0 , " Start Updating...." );
8684
8785 Serial.printf (" Start Updating....Type:%s\n " , (ArduinoOTA.getCommand () == U_FLASH) ? " sketch" : " filesystem" );
@@ -168,22 +166,22 @@ void setupWIFI()
168166 Heltec.display ->drawString (0 , 10 , String (ssid));
169167 Heltec.display ->display ();
170168
171- // 连接WiFiï¼Œåˆ é™¤æ—§çš„é…置,关é—WIFIï¼Œå‡†å¤‡é‡æ–°é…ç½?
169+ // 连接WiFiï¼Œåˆ é™¤æ—§çš„é…置,关é—WIFIï¼Œå‡†å¤‡é‡æ–°é…ç½?
172170 WiFi.disconnect (true );
173171 delay (1000 );
174172
175173 WiFi.mode (WIFI_STA);
176174 // WiFi.onEvent(WiFiEvent);
177175 WiFi.setAutoConnect (true );
178- WiFi.setAutoReconnect (true ); // æ–å¼€WiFiåŽè‡ªåЍ釿–°è¿žæŽ?ESP32ä¸å¯ç”?
176+ WiFi.setAutoReconnect (true ); // æ–å¼€WiFiåŽè‡ªåЍ釿–°è¿žæŽ?ESP32ä¸å¯ç”?
179177 // WiFi.setHostname(HOSTNAME);
180178 WiFi.begin (ssid, password);
181179#if USE_STATIC_IP
182180 WiFi.config (staticIP, gateway, subnet);
183181#endif
184182
185- // ç‰å¾…5000ms,如果没有连接上,就继ç»å¾€ä¸?
186- // ä¸ç„¶åŸºæœ¬åŠŸèƒ½ä¸å¯ç”?
183+ // ç‰å¾…5000ms,如果没有连接上,就继ç»å¾€ä¸?
184+ // ä¸ç„¶åŸºæœ¬åŠŸèƒ½ä¸å¯ç”?
187185 byte count = 0 ;
188186 while (WiFi.status () != WL_CONNECTED && count < 10 )
189187 {
@@ -228,12 +226,12 @@ void loop()
228226 unsigned long ms = millis ();
229227 if (ms % 1000 == 0 )
230228 {
231- Serial.println (" hello,OTA now" );
229+ Serial.println (" hello,OTA now" );
232230 }
233231}
234232
235233/* ***************************************************
236- * [通用函数]ESP32 WiFi Kit 32事件处ç†
234+ * [通用函数]ESP32 WiFi Kit 32事件处ç†
237235 */
238236void WiFiEvent (WiFiEvent_t event)
239237{
0 commit comments