frequency resistive sensor adjustment
This commit is contained in:
		@@ -90,7 +90,7 @@
 | 
				
			|||||||
    #define FLOWMETER_PULSES_PER_ML 2.2
 | 
					    #define FLOWMETER_PULSES_PER_ML 2.2
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MOIST_SENSOR_MAX_FRQ               60000 // 60kHz (500Hz margin)
 | 
					#define MOIST_SENSOR_MAX_FRQ               5200 // 60kHz (500Hz margin)
 | 
				
			||||||
#define MOIST_SENSOR_MIN_FRQ                500 // 0.5kHz (500Hz margin)
 | 
					#define MOIST_SENSOR_MIN_FRQ                500 // 0.5kHz (500Hz margin)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define ANALOG_SENSOR_MAX_MV                1300 //successive approximation of good range
 | 
					#define ANALOG_SENSOR_MAX_MV                1300 //successive approximation of good range
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -47,6 +47,8 @@ static const char *SENSOR_STRING[] = {
 | 
				
			|||||||
#define HYDROPONIC_MODE -3
 | 
					#define HYDROPONIC_MODE -3
 | 
				
			||||||
//plant uses cooldown and duration and workhours, moisture is measured but ignored
 | 
					//plant uses cooldown and duration and workhours, moisture is measured but ignored
 | 
				
			||||||
#define TIMER_ONLY -4
 | 
					#define TIMER_ONLY -4
 | 
				
			||||||
 | 
					//special value to indicate a shorted sensor when the plant is not deactivated but the sensor reads short circuit value
 | 
				
			||||||
 | 
					#define SHORT_CIRCUIT_MODE -5
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct PlantSettings_t
 | 
					typedef struct PlantSettings_t
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -148,6 +148,10 @@ public:
 | 
				
			|||||||
            {
 | 
					            {
 | 
				
			||||||
                return MISSING_SENSOR;
 | 
					                return MISSING_SENSOR;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            if (mMoisture_raw.getMedian() > MOIST_SENSOR_MAX_FRQ)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                return SHORT_CIRCUIT_MODE;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return mMoisture_raw.getMedian();
 | 
					        return mMoisture_raw.getMedian();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user