Notify write succes on oled

Disable led bar
Decrease oled brightness
This commit is contained in:
samuelbles07
2024-12-07 02:21:11 +07:00
parent cfe6fa9fd5
commit 20dcea20ad
2 changed files with 6 additions and 28 deletions

View File

@ -185,9 +185,6 @@ void setup() {
if (ag->isOne()) { if (ag->isOne()) {
oledDisplay.setText("Warming Up", "Serial Number:", ag->deviceId().c_str()); oledDisplay.setText("Warming Up", "Serial Number:", ag->deviceId().c_str());
delay(DISPLAY_DELAY_SHOW_CONTENT_MS); delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
// Serial.println("Display brightness: " + String(configuration.getDisplayBrightness()));
// oledDisplay.setBrightness(configuration.getDisplayBrightness());
} }
oledDisplay.setText("Offline Storage Mode", "Connecting to", "default WiFi"); oledDisplay.setText("Offline Storage Mode", "Connecting to", "default WiFi");
@ -628,6 +625,7 @@ static void oneIndoorInit(void) {
/** Display init */ /** Display init */
oledDisplay.begin(); oledDisplay.begin();
oledDisplay.setBrightness(40);
/** Show boot display */ /** Show boot display */
Serial.println("Firmware Version: " + ag->getVersion()); Serial.println("Firmware Version: " + ag->getVersion());
@ -935,7 +933,7 @@ static void updateDisplayAndLedBar(void) {
} else { } else {
stateMachine.displayHandle(AgStateMachineWiFiLost); stateMachine.displayHandle(AgStateMachineWiFiLost);
} }
stateMachine.handleLeds(AgStateMachineNormal); // stateMachine.handleLeds(AgStateMachineNormal);
return; return;
} }
@ -1195,30 +1193,9 @@ int calculateMaxPeriod(int updateInterval) {
void offlineStorageUpdate() { void offlineStorageUpdate() {
if (measurements.saveLocalStorage(*ag, configuration)) { if (measurements.saveLocalStorage(*ag, configuration)) {
// blue oledDisplay.setText("", "New Measurements", "");
ag->ledBar.setColor(0, 0, 255, 0);
ag->ledBar.show();
delay(250);
ag->ledBar.setColor(0, 0, 0, 0);
ag->ledBar.show();
delay(250);
ag->ledBar.setColor(0, 0, 255, 0);
ag->ledBar.show();
delay(250);
ag->ledBar.setColor(0, 0, 0, 0);
ag->ledBar.show();
} else { } else {
// red oledDisplay.setText("Failed write", "Measurements", "");
ag->ledBar.setColor(255, 0, 0, 0);
ag->ledBar.show();
delay(250);
ag->ledBar.setColor(0, 0, 0, 0);
ag->ledBar.show();
delay(250);
ag->ledBar.setColor(255, 0, 0, 0);
ag->ledBar.show();
delay(250);
ag->ledBar.setColor(0, 0, 0, 0);
ag->ledBar.show();
} }
delay(1200);
} }

View File

@ -1074,6 +1074,7 @@ bool Measurements::resetLocalStorage() {
return false; return false;
} }
Serial.println("Success reset local storage");
return true; return true;
} }