From ace7c8b67844bd1855d1d22c20613cf3565736f1 Mon Sep 17 00:00:00 2001 From: Marcus Date: Sun, 28 Apr 2024 22:59:26 +0200 Subject: [PATCH] firmware wip , add eeprom table in comments --- Arduino/CanGrow/CanGrow.ino | 59 +++++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/Arduino/CanGrow/CanGrow.ino b/Arduino/CanGrow/CanGrow.ino index 47b517c..c79a57f 100644 --- a/Arduino/CanGrow/CanGrow.ino +++ b/Arduino/CanGrow/CanGrow.ino @@ -110,6 +110,7 @@ bool UseFan; // In case the user uses no 12V LED on the LED output and an relais instead // we have to disable PWM. So we ask here for what kind of light user is going bool UseLEDrelais; +bool UseFANrelais; // Which temperature sensor to use? byte TemperatureSensor_Type; @@ -140,7 +141,7 @@ byte SunriseMinute = 0; // PINled_PWM - contains the PWM value for dimming the grow light // default is 255 to ensure it is just on for the case UseLEDrelais is true byte PINled_PWM = 255; - +byte PINfan_PWM = 255; /* * @@ -367,14 +368,14 @@ function convertDateToEpoch(src, dst) { */ // D0 is HIGH at boot, no PWM -const uint8_t PINfan = D0; +const uint8_t PINpump = D0; // If D3 is pulled to LOW, boot fails const uint8_t PINdht = D3; // D4 is HIGH at boot, boot fail if pulled to LOW // During Start Screen you can pull D4 to LOW to wipe saved data in EEPROM // DO NOT PULL D4 DOWN AT WHEN POWERING ON !!! BOOT WILL FAIL const uint8_t PIN_WIPE = D4; -const uint8_t PINpump = D5; +const uint8_t PINfan = D5; const uint8_t PINled = D6; // const uint8_t PINwaterlevel = D7; const uint8_t PINsoilmoisture = D8; @@ -674,6 +675,43 @@ void wipeEEPROM() { bool loadEEPROM() { + /* + * EEPROM Save table + * + * 0 WIFIssid + * 32 WIFIpassword + * 96 WIFIip + * 112 WIFInetmask + * 128 WIFIgateway + * 144 WIFIdns + * 160 WIFIuseDHCP + * + * 161 configured + * 162 UseFan + * 163 UsePump + * 164 PumpOnTime + * 165 MoistureSensor_Type + * 166 SoilmoistureLow + * 167 ntpOffset + * 169 UseLEDrelais + * + * 170 GrowName + * 202 GrowStart + * 206 DaysVeg + * 207 DaysBloom + * 208 LighthoursVet + * 209 LighthoursBloom + * 210 SunriseHour + * 211 SunriseMinute + * 212 DayOfGrow + * + * -- afterwards added, need to sort -- + * + * 213 UseLEDrelais + * 214 TemperatureSensor_Type + * + */ + Serial.println(":: loading EEPROM ::"); display.setCursor(0,36); @@ -1949,8 +1987,19 @@ void APIgetSensors() { - - +/* + * + * TODO LIST / NOTES + * + * + * - Sunrise and Sunset PWM if PWM is set + * - PWM for fan control + * - avoid using javascript to set the GrowName in the Menu and the time + * as well + * - + * + * +*/