diff --git a/hot_fermentation.ino b/hot_fermentation.ino index c5841e1..902558a 100644 --- a/hot_fermentation.ino +++ b/hot_fermentation.ino @@ -23,7 +23,7 @@ struct Phase { struct Profile { const char* name; - Phase phases[7]; // Maximum of 6 phases per profile + Phase phases[6]; // Maximum of 6 phases per profile int numPhases; }; @@ -32,12 +32,11 @@ Profile profiles[] = { {"Test", {{49, 1}, {51, 1}, {55, 1}, {45, 1}}, 4}, {"Пшеница", {{47, 40}, {55, 40}, {65, 20}, {72, 20}, {85, 20}}, 5}, {"Veggies Sous Vide", {{85, 120}}, 1}, - {"Profile 4", {{47, 120}, {53, 120}, {65, 150}, {72, 60}, {90, 105}, {50, 60}}, 6}, - {"Profile 5", {{55, 60}, {65, 120}, {72, 120}, {80, 120}, {90, 30}, {10, 100}}, 6} + {"Фитаза/Протеаза", {{47, 120}, {53, 120}, {65, 150}, {72, 60}, {90, 105}, {50, 60}}, 6}, }; // Select active profile (constant at this point) -const int activeProfileIndex = 1; // Index of the active profile, starting from 0 +const int activeProfileIndex = 0; // Index of the active profile, starting from 0 Profile activeProfile = profiles[activeProfileIndex]; // PID Control variables @@ -140,9 +139,9 @@ void printPhases(int currentPhase, unsigned long phaseElapsedTime) { oled.print(i + 1); oled.print(". "); oled.print((int)Input); - oled.print("C "); + oled.print("c "); oled.print((int)Setpoint); - oled.print("C "); + oled.print("c "); oled.print(timeBuffer); } else { oled.invertText(false); // Normal text for other phases @@ -152,7 +151,7 @@ void printPhases(int currentPhase, unsigned long phaseElapsedTime) { oled.print(i + 1); oled.print(". "); oled.print(activeProfile.phases[i].temperature); - oled.print("C "); + oled.print("c "); oled.print(timeBuffer); } } @@ -161,13 +160,19 @@ void printPhases(int currentPhase, unsigned long phaseElapsedTime) { } void formatTime(long seconds, char* buffer) { - long hours = seconds / 3600; - long mins = (seconds % 3600) / 60; - int secs = seconds % 60; + long hours = seconds / 3600; + long mins = (seconds % 3600) / 60; + int secs = seconds % 60; - if (hours > 0) { - sprintf(buffer, "%ld:%02ld:%02d", hours, mins, secs); - } else { - sprintf(buffer, "%ld:%02d", mins, secs); - } + buffer[0] = '\0'; // Ensure the buffer is empty + + if (hours > 0) { + sprintf(buffer + strlen(buffer), "%ldh", hours); + } + if (mins > 0) { + sprintf(buffer + strlen(buffer), "%ldm", mins); + } + if (secs > 0) { + sprintf(buffer + strlen(buffer), "%ds", secs); + } }