Phazz писал(а): 25 янв 2026, 20:54
vitalik9 писал(а): 25 янв 2026, 19:43
Пробовал создать блок из скетча после создания пользовательского блока и проверке в 8,2,3 в ide куча ошибок. Ктото пробовал эту программу?
Она еще в процессе доработки. А какие ошибки у вас и образец кода дайте пожалуйста.
вот ошибки в ide
C:\Users\Iulia\AppData\Local\Temp\flprog\pr3\pr3.ino: In function 'void setup()':
pr3:41:3: error: 'WiFi' was not declared in this scope
WiFi.mode(WIFI_STA);
^~~~
C:\Users\Iulia\AppData\Local\Temp\flprog\pr3\pr3.ino:41:3: note: suggested alternative: 'Wire'
WiFi.mode(WIFI_STA);
^~~~
Wire
pr3:41:13: error: 'WIFI_STA' was not declared in this scope
WiFi.mode(WIFI_STA);
^~~~~~~~
C:\Users\Iulia\AppData\Local\Temp\flprog\pr3\pr3.ino:41:13: note: suggested alternative: 'WIFI_IF_STA'
WiFi.mode(WIFI_STA);
^~~~~~~~
WIFI_IF_STA
pr3:42:14: error: 'WIFI_SSID' was not declared in this scope
WiFi.begin(WIFI_SSID, WIFI_PASS);
^~~~~~~~~
C:\Users\Iulia\AppData\Local\Temp\flprog\pr3\pr3.ino:42:14: note: suggested alternative: 'MIP_SSIP'
WiFi.begin(WIFI_SSID, WIFI_PASS);
^~~~~~~~~
MIP_SSIP
pr3:42:25: error: 'WIFI_PASS' was not declared in this scope
WiFi.begin(WIFI_SSID, WIFI_PASS);
^~~~~~~~~
C:\Users\Iulia\AppData\Local\Temp\flprog\pr3\pr3.ino:42:25: note: suggested alternative: 'WIFI_EVENT'
WiFi.begin(WIFI_SSID, WIFI_PASS);
^~~~~~~~~
WIFI_EVENT
pr3:46:27: error: 'WL_CONNECTED' was not declared in this scope
while (WiFi.status() != WL_CONNECTED && (millis() - t0) < 20000) {
^~~~~~~~~~~~
pr3:52:24: error: 'WL_CONNECTED' was not declared in this scope
if (WiFi.status() == WL_CONNECTED) {
^~~~~~~~~~~~
C:\Users\Iulia\AppData\Local\Temp\flprog\pr3\pr3.ino: In function 'void loop()':
pr3:99:7: error: 'WiFi' was not declared in this scope
if (WiFi.status() != WL_CONNECTED) {
^~~~
C:\Users\Iulia\AppData\Local\Temp\flprog\pr3\pr3.ino:99:7: note: suggested alternative: 'Wire'
if (WiFi.status() != WL_CONNECTED) {
^~~~
Wire
pr3:99:24: error: 'WL_CONNECTED' was not declared in this scope
if (WiFi.status() != WL_CONNECTED) {
^~~~~~~~~~~~
pr3:115:3: error: 'HTTPClient' was not declared in this scope
HTTPClient http;
^~~~~~~~~~
C:\Users\Iulia\AppData\Local\Temp\flprog\pr3\pr3.ino:115:3: note: suggested alternative: 'DNSClient'
HTTPClient http;
^~~~~~~~~~
DNSClient
pr3:116:3: error: 'http' was not declared in this scope
http.setTimeout(15000);
^~~~
pr3:137:3: error: 'StaticJsonDocument' was not declared in this scope
StaticJsonDocument<2048> doc;
^~~~~~~~~~~~~~~~~~
C:\Users\Iulia\AppData\Local\Temp\flprog\pr3\pr3.ino:137:3: note: suggested alternative: 'StaticQueue_t'
StaticJsonDocument<2048> doc;
^~~~~~~~~~~~~~~~~~
StaticQueue_t
pr3:137:28: error: 'doc' was not declared in this scope
StaticJsonDocument<2048> doc;
^~~
pr3:138:3: error: 'DeserializationError' was not declared in this scope
DeserializationError err = deserializeJson(doc, body);
^~~~~~~~~~~~~~~~~~~~
pr3:139:7: error: 'err' was not declared in this scope
if (err) {
^~~
C:\Users\Iulia\AppData\Local\Temp\flprog\pr3\pr3.ino:139:7: note: suggested alternative: 'erf'
if (err) {
^~~
erf
pr3:145:3: error: 'JsonObject' was not declared in this scope
JsonObject cur = doc["current"];
^~~~~~~~~~
pr3:146:7: error: 'cur' was not declared in this scope
if (cur.isNull() ||
^~~
pr3:155:14: error: 'cur' was not declared in this scope
float T = cur["temperature_2m"].as<float>();
^~~
pr3:155:39: error: expected primary-expression before 'float'
float T = cur["temperature_2m"].as<float>();
^~~~~
pr3:156:45: error: expected primary-expression before 'float'
float RH = cur["relative_humidity_2m"].as<float>();
^~~~~
pr3:157:37: error: expected primary-expression before 'float'
float DP = cur["dew_point_2m"].as<float>();
^~~~~
pr3:158:73: error: expected primary-expression before 'float'
float PR = cur.containsKey("precipitation") ? cur["precipitation"].as<float>() : 0.0f;
^~~~~
pr3:158:73: error: expected ':' before 'float'
float PR = cur.containsKey("precipitation") ? cur["precipitation"].as<float>() : 0.0f;
^~~~~
:
pr3:158:73: error: expected primary-expression before 'float'
float PR = cur.containsKey("precipitation") ? cur["precipitation"].as<float>() : 0.0f;
^~~~~
exit status 1
'WiFi' was not declared in this scope