change waterlevel offset factor
This commit is contained in:
parent
b5b9c1b221
commit
5305fd80f9
3 changed files with 9 additions and 9 deletions
|
@ -10,9 +10,6 @@
|
|||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// +++++++++++++++ Common Parameters ++++++++++
|
||||
|
||||
#define READINTERVAL_WATERLEVEL 2000
|
||||
|
@ -188,7 +185,9 @@ void waterlevel_loop(unsigned long loopmillis) {
|
|||
|
||||
distance=tofsensor.readRangeSingleMillimeters(); //out of range =255
|
||||
|
||||
Serial.print("Distance reading B="); Serial.print(distance);Serial.println();
|
||||
Serial.print("Distance reading B="); Serial.print(distance);
|
||||
Serial.print(" Level="); Serial.print(constrain((waterlevel_calib_offset+distance)*waterlevel_calib_factor,0,1000));
|
||||
Serial.println();
|
||||
|
||||
|
||||
if (distance!=DISTANCE_UNAVAILABLE) { //successful
|
||||
|
@ -214,7 +213,7 @@ void waterlevel_loop(unsigned long loopmillis) {
|
|||
|
||||
|
||||
//Invert distance and offset
|
||||
waterlevel=constrain(waterlevel_calib_offset+waterlevel_calib_factor*_filteredDistance,0,1000);
|
||||
waterlevel=constrain((waterlevel_calib_offset+_filteredDistance)*waterlevel_calib_factor,0,1000);
|
||||
watervolume=waterlevel_heightToVolume(waterlevel);
|
||||
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ build_flags=
|
|||
-D THERMOMETER_ADDR_CASE={0x10,0x7E,0x22,0x99,0x01,0x08,0x00,0xA4}
|
||||
-D PIN_SDA=21
|
||||
-D PIN_SCL=22
|
||||
-D WATERLEVEL_OFFSET=500.0
|
||||
-D WATERLEVEL_OFFSET=-490.0
|
||||
-D WATERLEVEL_FACTOR=-1.0
|
||||
-D RES_AREA=20*20*3.1416
|
||||
-D WATERLEVELSENSOR_VL53L1X
|
||||
|
@ -71,7 +71,7 @@ build_flags=
|
|||
-D PIN_SDA=1
|
||||
-D PIN_SCL=2
|
||||
|
||||
-D WATERLEVEL_OFFSET=252.0
|
||||
-D WATERLEVEL_OFFSET=-252.0
|
||||
-D WATERLEVEL_FACTOR=-1.0
|
||||
-D RES_AREA=37*56
|
||||
-D WATERLEVELSENSOR_VL53L1X
|
||||
|
@ -121,7 +121,7 @@ build_flags=
|
|||
-D PIN_SDA=1
|
||||
-D PIN_SCL=2
|
||||
|
||||
-D WATERLEVEL_OFFSET=470.0
|
||||
-D WATERLEVEL_OFFSET=-470.0
|
||||
-D WATERLEVEL_FACTOR=-1.0
|
||||
-D RES_AREA=20*20*3.1416
|
||||
-D WATERLEVELSENSOR_VL53L1X
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <Arduino.h>
|
||||
#include <Wire.h>
|
||||
|
||||
|
||||
// ESP32-S3 Devkit M-1 Left USB-C: Program, Right USB-C Serial
|
||||
|
||||
bool valueError=false;
|
||||
|
@ -137,7 +138,7 @@ void setup() {
|
|||
if (adsenabled){
|
||||
ADS.setGain(0);
|
||||
}
|
||||
|
||||
|
||||
Serial.println("Setup EC");
|
||||
ec_setup();
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue