From 2a6d1df66a024a14e4664da3a8b2a5b0302aa158 Mon Sep 17 00:00:00 2001
From: DeltaLima
Date: Mon, 9 Dec 2024 01:26:52 +0100
Subject: [PATCH] firmware - v0.1.0 - really this time! added configurable
display rotation
---
Arduino/CanGrow/CanGrow_Init.h | 3 +-
Arduino/CanGrow/CanGrow_SysFunctions.h | 18 +++++--
Arduino/CanGrow/CanGrow_WebFunctions.h | 29 ++++++----
README.md | 73 +++++++++++++++++++++++++-
4 files changed, 103 insertions(+), 20 deletions(-)
diff --git a/Arduino/CanGrow/CanGrow_Init.h b/Arduino/CanGrow/CanGrow_Init.h
index 41a377a..20c9fcf 100644
--- a/Arduino/CanGrow/CanGrow_Init.h
+++ b/Arduino/CanGrow/CanGrow_Init.h
@@ -31,7 +31,6 @@ bool NeedRestart;
bool FirstRun;
// which screen should be actually displayed
byte ScreenToDisplay = 0;
-byte DisplayScreenDuration = 3;
// how many seconds actual screen got displayed
byte ScreenIterationPassed = 0;
@@ -115,7 +114,7 @@ bool OutputInvert;
unsigned short SoilmoistureWet;
unsigned short SoilmoistureDry;
unsigned short PWMFrequency = 13370;
-
+byte DisplayScreenDuration = 3;
//
diff --git a/Arduino/CanGrow/CanGrow_SysFunctions.h b/Arduino/CanGrow/CanGrow_SysFunctions.h
index f2531c9..f6e3c88 100644
--- a/Arduino/CanGrow/CanGrow_SysFunctions.h
+++ b/Arduino/CanGrow/CanGrow_SysFunctions.h
@@ -113,7 +113,8 @@ bool loadEEPROM() {
* 248 PinFAN2PWM (1 byte)
* 249 HumiditySensor_Type (1 byte)
* 250 PWMFrequency (2 byte)
- * 252 ...
+ * 252 DisplayScreenDuration (1 byte)
+ * 253
*
*/
@@ -187,6 +188,10 @@ bool loadEEPROM() {
EEPROM.get(246, SoilmoistureDry);
// size is 1 byte
EEPROM.get(249, HumiditySensor_Type);
+ // size is 2 byte
+ EEPROM.get(250, PWMFrequency);
+ // size is 1 byte
+ EEPROM.get(252, DisplayScreenDuration);
}
// TODO auth does not work atm
// EEPROM.get(160, WebUiUsername);
@@ -227,8 +232,7 @@ bool loadEEPROM() {
EEPROM.get(242, PumpIntervalBloom);
// size is 1 byte
EEPROM.get(248, PinFAN2PWM);
- // size is 2 byte
- EEPROM.get(250, PWMFrequency);
+
}
@@ -609,8 +613,12 @@ void displayScreens() {
display.println("s");
} else {
// in this switch case the single screens gets defined
- //switch(ScreenToDisplay) {
- switch(0) {
+ // when DisplayScreenDuration is 0, always show 0
+ if(DisplayScreenDuration == 0) {
+ ScreenToDisplay = 0;
+ }
+ switch(ScreenToDisplay) {
+ // switch(0) { // just for testing, show screen 0 only
case 0:
display.print("Humidity: ");
display.print(valHumidity);
diff --git a/Arduino/CanGrow/CanGrow_WebFunctions.h b/Arduino/CanGrow/CanGrow_WebFunctions.h
index 302d921..8032ed1 100644
--- a/Arduino/CanGrow/CanGrow_WebFunctions.h
+++ b/Arduino/CanGrow/CanGrow_WebFunctions.h
@@ -588,6 +588,14 @@ void WEBsystemSettings() {
body += "\n";
body += "
\n";
*/
+
+ // OutputInvert bool
+ body += "Invert Outputs:
\n";
+
// PumpMode byte
body += "Pump mode:
\n";
-
-
- // OutputInvert bool
- body += "Invert Outputs:
\n";
-
// UseLEDrelais bool
- body += "Use relais for LED: