|
|
@ -457,6 +457,8 @@ void checkBat() {
|
|
|
|
void runWater() {
|
|
|
|
void runWater() {
|
|
|
|
drawButton(0, 20, 320, 220, "Watering! Please wait.", ILI9341_WHITE);
|
|
|
|
drawButton(0, 20, 320, 220, "Watering! Please wait.", ILI9341_WHITE);
|
|
|
|
upd = true;
|
|
|
|
upd = true;
|
|
|
|
|
|
|
|
pinMode(7, OUTPUT);
|
|
|
|
|
|
|
|
digitalWrite(7, HIGH);
|
|
|
|
getMoisture();
|
|
|
|
getMoisture();
|
|
|
|
if(s1 && map(soil1.touchRead(0), 0, 1023, 0, 100) <= 50) {
|
|
|
|
if(s1 && map(soil1.touchRead(0), 0, 1023, 0, 100) <= 50) {
|
|
|
|
int td = 50 - map(soil1.touchRead(0), 0, 1023, 0, 100);
|
|
|
|
int td = 50 - map(soil1.touchRead(0), 0, 1023, 0, 100);
|
|
|
@ -498,6 +500,7 @@ void runWater() {
|
|
|
|
delay(td * 100);
|
|
|
|
delay(td * 100);
|
|
|
|
digitalWrite(5, HIGH);
|
|
|
|
digitalWrite(5, HIGH);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
digitalWrite(7, LOW);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void getMoisture() {
|
|
|
|
void getMoisture() {
|
|
|
|
float h = dht.readHumidity();
|
|
|
|
float h = dht.readHumidity();
|
|
|
|