From 1b60d35130311ee3ffb4d0994e0503c8b6ec52cb Mon Sep 17 00:00:00 2001 From: Erik Foris Date: Sun, 7 Nov 2021 12:31:45 +0000 Subject: [PATCH] Add logic to test for tempreture --- sketch_dec12a/sketch_dec12a.ino | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/sketch_dec12a/sketch_dec12a.ino b/sketch_dec12a/sketch_dec12a.ino index 0a36842..8ec4fde 100644 --- a/sketch_dec12a/sketch_dec12a.ino +++ b/sketch_dec12a/sketch_dec12a.ino @@ -1,4 +1,4 @@ -const int tmp_aufw =9; +2212const int tmp_aufw =9; const int tmp_abw =10; const int tmp_sens = A7; @@ -42,16 +42,20 @@ void kaelter(){ void loop() { Serial.println(analogRead(tmp_sens)); -kaelter(); +//kaelter(); delay(1000); //warmer(); -if(analogRead(tmp_sens) > ){ - -}else if(analogRead(tmp_sens) >){ - +if(analogRead(tmp_sens) > 152 ){ // 12°C + warmer(); + Serial.println("To Cold -> Warmer"); +}else if(analogRead(tmp_sens) < 150 ){ // 14°C + kaelter(); + Serial.println("To warm -> Colder"); } else{ - -} + Serial.println("Wihin Margen"); + +} +delay(1000); }