我在网上下载了一个Arduino “太空人WIFI时钟”,硬件用的是NodeMCU_ESP8266WIFI模块,同时添加了必须的ArduinoJson、TFT_eSPI、Time-Library和ESP8266wifi_master库文件,但是编译时总是通不过,部分出错信息为:
E:\我的桌面\太空人天气时钟\CLOCK\CLOCK.ino: In function 'void getCityWeater()':
CLOCK:246:19: error: call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)
E:\我的桌面\太空人天气时钟-1.14版本\CLOCK\CLOCK.ino: In function 'void getCityCode()':
CLOCK:203:19: error: call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)
同时编译时停在下图中的行:
錯誤訊息:
CLOCK:246:19: (246 行)
error: call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)
.
CLOCK:203:19: (203 行)
error: call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)
.
-- httpClient.begin(URL); -- 已經過期,新的用法是 begin(WiFiClient, url)
詳細情況可能需要去找 HTTPClient 的使用手冊。
水平有限,这使用手册也看不懂啊。