playing around

This commit is contained in:
Marcus 2024-04-07 03:55:17 +02:00
parent af0f7715bf
commit e9abdeb283

View file

@ -34,6 +34,9 @@ uint8_t PINwaterlevel = D7;
uint8_t PINsoilmoisture = D8;
uint8_t PINanalog = A0;
int D6status = false;
#define WIRE Wire
#define DHTTYPE DHT11
@ -306,7 +309,21 @@ void loop() {
display.display();
Serial.println("Test");
delay(1000);
if(getWaterlevel() < 2) {
digitalWrite(PINled, LOW);
digitalWrite(PINpump, LOW);
digitalWrite(PINfan, LOW);
D6status = false;
Serial.println("D6 is off now");
} else {
digitalWrite(PINled, HIGH);
digitalWrite(PINpump, HIGH);
digitalWrite(PINfan, HIGH);
D6status = true;
Serial.println("D6 is ON now");
}
delay(100);
}