chciałbym prosić o pomoc, ewentualie o wyjaśnienie nastepującego problemu. Mam w kodzie funkcję :
Code: Select all
bool wait_for_supla_connection(unsigned long timeout_ms) {
unsigned long start = millis();
while (millis() - start < timeout_ms) {
SuplaDevice.iterate();
if (suplaStatus == STATUS_REGISTERED_AND_READY) {
return true;
}
delay(50);
}
return false;
}Funkcję tą wywołuję na końcu Setup() (zamiast delay(4000);) ,
dane zmierzone wysyłam nastepnie w pętli loop z kontrolą Supla::Element::IsAnyUpdatePending():
Code: Select all
...
if (sleep_time_sec != 0) {
if (sensorT1) T1_temp = sensorT1->getValue();
napięcie_baterii();
pomiar_bme280();
unsigned long start = millis();
while (Supla::Element::IsAnyUpdatePending() && millis() - start < 4000) {
SuplaDevice.iterate();
delay(20);
}
DeepSleep();
}Pozdrawiam

