change back to ec measurement only

This commit is contained in:
interfisch 2023-05-05 00:03:47 +02:00
parent 3f62820e22
commit 09b090f58f
1 changed files with 7 additions and 40 deletions

View File

@ -34,7 +34,7 @@ unsigned long last_print=0;
#define PIN_BUTTON 12
#define PIN_LED 2
#define PIN_LED 13
void setup() {
@ -86,16 +86,16 @@ void loop() {
//ec_loop(loopmillis);
ec_loop(loopmillis);
//temperature_loop(loopmillis);
temperature_loop(loopmillis);
//waterlevel_loop(loopmillis);
flow_loop(loopmillis);
//flow_loop(loopmillis);
//sm_loop(loopmillis);
@ -109,42 +109,9 @@ void loop() {
digitalWrite(PIN_LED,HIGH);
}
static bool started=false;
static bool ended=false;
static unsigned long started_time=0;
static unsigned long ended_time=0;
if (flow_counter_sum>10 && !started && !ended) { //start
started=true;
started_time=millis();
Serial.println("Started!");
}
static uint32_t last_flow_counter_sum=0;
if (loopmillis>last_print+1000) { //test check
last_print=loopmillis;
if (started && !ended) {
Serial.println(flow_counter_sum-last_flow_counter_sum);
if (flow_counter_sum-last_flow_counter_sum<=2){ //stopped
ended=true;
ended_time=millis();
Serial.println("Ended!");
}
last_flow_counter_sum=flow_counter_sum;
}
if (ended) {
Serial.println("counts,time");
Serial.print(flow_counter_sum);
Serial.print(",");
Serial.print((ended_time-started_time)/1000.0);
Serial.println();
delay(10000);
}
}
if (loopmillis>last_print+2000 && 1==2) {
if (loopmillis>last_print+2000) {
//if (ec_flag_measurement_available && getReading) {
if (ec_flag_measurement_available) {
last_print=loopmillis;
@ -154,7 +121,7 @@ void loop() {
Serial.print(millis()/1000.0,2); Serial.print(",");
/*
Serial.print(getMeanf(tempCmean_reservoir,TEMPMEAN_SIZE)); Serial.print(",");
//Serial.print(getMean(sm_mean,SM_SIZE)); Serial.print(",");
@ -163,7 +130,7 @@ void loop() {
Serial.print(ec_adc_adjusted); //Serial.print(",");
//Serial.print(ec); Serial.print(",");
//Serial.print(ec25);
*/