Add logic to test for tempreture

This commit is contained in:
Erik Foris 2021-11-07 12:31:45 +00:00
parent bade5afa40
commit 1b60d35130

View File

@ -1,4 +1,4 @@
const int tmp_aufw =9; 2212const int tmp_aufw =9;
const int tmp_abw =10; const int tmp_abw =10;
const int tmp_sens = A7; const int tmp_sens = A7;
@ -42,16 +42,20 @@ void kaelter(){
void loop() { void loop() {
Serial.println(analogRead(tmp_sens)); Serial.println(analogRead(tmp_sens));
kaelter(); //kaelter();
delay(1000); delay(1000);
//warmer(); //warmer();
if(analogRead(tmp_sens) > ){ if(analogRead(tmp_sens) > 152 ){ // 12°C
warmer();
}else if(analogRead(tmp_sens) >){ Serial.println("To Cold -> Warmer");
}else if(analogRead(tmp_sens) < 150 ){ // 14°C
kaelter();
Serial.println("To warm -> Colder");
} else{ } else{
Serial.println("Wihin Margen");
} }
delay(1000);
} }