diff --git a/Arduino/CanGrow/CanGrow_Init.h b/Arduino/CanGrow/CanGrow_Init.h index 80a4e68..ab1e466 100644 --- a/Arduino/CanGrow/CanGrow_Init.h +++ b/Arduino/CanGrow/CanGrow_Init.h @@ -110,8 +110,8 @@ char Esp32CamIP[16]; // PumpLastOn (long) timestamp unsigned long PumpLastOn; bool OutputInvert; -byte SoilmoistureWet; -byte SoilmoistureDry; +unsigned short SoilmoistureWet; +unsigned short SoilmoistureDry; diff --git a/Arduino/CanGrow/CanGrow_Sensors.h b/Arduino/CanGrow/CanGrow_Sensors.h index 96fed03..c41f101 100644 --- a/Arduino/CanGrow/CanGrow_Sensors.h +++ b/Arduino/CanGrow/CanGrow_Sensors.h @@ -138,19 +138,19 @@ int getSoilmoisture(byte moistureSensor, bool returnRAW = false) { // value to return int soilmoisture = 0; // value for wet - int wet; + //~ int wet; // value for dry - int dry; + //~ int dry; switch(moistureSensor) { case 1: // read analog value from analog moisture sensor - wet = 180; + //~ wet = 180; // this value was measured in air, without contact to anything //dry= 590; // was measured in dry soil, not bone dry but really dry (6 days no watering) - dry = 360; + //~ dry = 360; digitalWrite(PINsoilmoisture, HIGH); // wait a bit to let the circuit stabilize @@ -172,22 +172,22 @@ int getSoilmoisture(byte moistureSensor, bool returnRAW = false) { // wet = 560; // measured in fresh watered soil - wet = 485; - dry= 250; + //~ wet = 485; + //~ dry= 250; // get raw value from I2C chirp sensor soilmoisture = readI2CRegister16bit(0x20, 0); break; default: - wet = 0; - dry = 1; + //~ wet = 0; + //~ dry = 1; soilmoisture = -1; } if(returnRAW == true) { return soilmoisture; } else { - short soilmoistureP = map(soilmoisture, wet, dry, 100, 0); + short soilmoistureP = map(soilmoisture, SoilmoistureWet, SoilmoistureDry, 100, 0); // dont return negative percentage values if(soilmoistureP < 0) { return 0; diff --git a/Arduino/CanGrow/CanGrow_Version.h b/Arduino/CanGrow/CanGrow_Version.h index 1ada704..7096eff 100644 --- a/Arduino/CanGrow/CanGrow_Version.h +++ b/Arduino/CanGrow/CanGrow_Version.h @@ -1,5 +1,5 @@ /* CanGrow_Version.h gets generated from cangrow.sh */ const char* CanGrowVer = "0.1-dev"; -const char* CanGrowBuild = "c178191-20241205031352"; +const char* CanGrowBuild = "65e6989-20241205031950";