Added offline mode after LED test.

This commit is contained in:
Achim
2024-02-29 18:15:22 +07:00
parent 852fdc4360
commit 236c5bab84

View File

@ -1,4 +1,4 @@
/* /*
This is the code for the AirGradient ONE open-source hardware indoor Air Quality This is the code for the AirGradient ONE open-source hardware indoor Air Quality
Monitor with an ESP32-C3 Microcontroller. Monitor with an ESP32-C3 Microcontroller.
@ -744,7 +744,7 @@ void setup() {
agServer.begin(); agServer.begin();
/** Run LED test on start up */ /** Run LED test on start up */
displayShowText("Press now for", "LED test", ""); displayShowText("Press now for", "LED test &", "offline mode");
bool test = false; bool test = false;
uint32_t stime = millis(); uint32_t stime = millis();
while (1) { while (1) {
@ -760,9 +760,10 @@ void setup() {
} }
if (test) { if (test) {
ledTest(); ledTest();
} } else {
/** WIFI connect */
connectToWifi(); connectToWifi();
}
/** /**
* Send first data to ping server and get server configuration * Send first data to ping server and get server configuration
@ -1168,12 +1169,12 @@ static void factoryConfigReset(void) {
if (ms >= 2000) { if (ms >= 2000) {
// Show display message: For factory keep for x seconds // Show display message: For factory keep for x seconds
// Count display. // Count display.
displayShowText("For factory reset", "keep pressed", "for 8 sec"); displayShowText("Factory reset", "keep pressed", "for 8 sec");
int count = 7; int count = 7;
while (ag.button.getState() == ag.button.BUTTON_PRESSED) { while (ag.button.getState() == ag.button.BUTTON_PRESSED) {
delay(1000); delay(1000);
displayShowText("For factory reset", "keep pressed", displayShowText("Factory reset", "keep pressed",
"for " + String(count) + " sec"); "for " + String(count) + " sec");
count--; count--;
// ms = (uint32_t)(millis() - factoryBtnPressTime); // ms = (uint32_t)(millis() - factoryBtnPressTime);