calibrations

This commit is contained in:
interfisch 2024-07-30 13:41:41 +02:00
parent 513111b656
commit a6560e4490
3 changed files with 14 additions and 7 deletions

View File

@ -50,11 +50,11 @@ uint16_t distance=DISTANCE_UNAVAILABLE;
//Calibration
float waterlevel_calib_offset=500.0; //c
float waterlevel_calib_factor=-1.0; //m
float waterlevel_calib_offset=WATERLEVEL_OFFSET; //c
float waterlevel_calib_factor=WATERLEVEL_FACTOR; //m
float waterlevel_calib_reservoirArea=20*20*3.1416; //area in cm^2. barrel diameter inside is 400mm
float waterlevel_calib_reservoirArea=RES_AREA; //area in cm^2
uint16_t distance_unsuccessful_count=0;

View File

@ -32,6 +32,9 @@ 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_FACTOR=-1.0
-D RES_AREA=20*20*3.1416
lib_deps =
https://github.com/milesburton/Arduino-Temperature-Control-Library/
@ -53,7 +56,7 @@ monitor_speed = 115200
build_flags=
'-D CLIENT_ID="hydroponic-Test"'
'-D CLIENT_ID="hydroponic-DB"'
-D PIN_BUTTON=12
-D EC_PIN_RELAY_PROBE=35
@ -72,6 +75,10 @@ build_flags=
-D PIN_SDA=1
-D PIN_SCL=2
-D WATERLEVEL_OFFSET=315.0
-D WATERLEVEL_FACTOR=-1.0
-D RES_AREA=37*56
lib_deps =
https://github.com/milesburton/Arduino-Temperature-Control-Library/
https://github.com/emilv/ArduinoSort/

View File

@ -8,8 +8,8 @@ unsigned long last_check=0;
#include "wifi_functions.h"
bool debug=true; //print Serial information
bool mqtt=false;
bool debug=false; //print Serial information
bool mqtt=true;
bool eccalibrationoutput=false; //serial output for ec calibration
/* Write to file with:
sudo stty -F /dev/ttyUSB0 115200
@ -243,7 +243,7 @@ void loop() {
digitalWrite(PIN_LED,(loopmillis/250)%2==0); //blink led
#endif
#ifdef PIN_NEOPIXEL
pixels.setPixelColor(0, pixels.Color((loopmillis/250)%2==0,(loopmillis/250)%2==0,0));
pixels.setPixelColor(0, pixels.Color(((loopmillis/250)%2==0)*255,((loopmillis/250)%2==0)*255,0));
pixels.show();
#endif
}else{ //LED shows valueError flag status when values were okay once