fixed analog probe being backwards, extended range for frequency one

This commit is contained in:
Empire 2022-04-29 10:14:50 +02:00
parent c43da98245
commit 4a86d8c41c
2 changed files with 5 additions and 5 deletions

View File

@ -86,7 +86,7 @@
#define CONFIG_COMPILER_CXX_EXCEPTIONS
#define FIRMWARE_VERSION "2.3 @ 0.10b"
#define FIRMWARE_VERSION "2.4 HW0.10b"
#define TIMED_LIGHT_PIN CUSTOM1_PIN5
#define FLOWMETER_PIN CUSTOM1_PIN1
@ -95,10 +95,10 @@
#endif
#define MOIST_SENSOR_MAX_FRQ 60000 // 60kHz (500Hz margin)
#define MOIST_SENSOR_MIN_FRQ 1000 // 1kHz (500Hz margin)
#define MOIST_SENSOR_MIN_FRQ 500 // 0.5kHz (500Hz margin)
#define ANALOG_SENSOR_MAX_MV 4095 /**< Maximum according https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/adc.html */
#define ANALOG_SENSOR_MIN_MV 100
#define ANALOG_SENSOR_MAX_MV 1300 //successive approximation of good range
#define ANALOG_SENSOR_MIN_MV 300 //successive approximation of good range
#define SOLAR_VOLT_FACTOR 11
#define BATTSENSOR_INDEX_SOLAR 0

View File

@ -131,7 +131,7 @@ public:
case CAPACITIVE_FREQUENCY:
return mapf(mMoisture_raw.getMedian(), MOIST_SENSOR_MAX_FRQ, MOIST_SENSOR_MIN_FRQ, 0, 100);
case ANALOG_RESISTANCE_PROBE:
return mapf(mMoisture_raw.getMedian(), ANALOG_SENSOR_MIN_MV, ANALOG_SENSOR_MAX_MV, 0, 100);
return mapf(mMoisture_raw.getMedian(), ANALOG_SENSOR_MAX_MV, ANALOG_SENSOR_MIN_MV, 0, 100);
}
return MISSING_SENSOR;
}