Skip to content
Snippets Groups Projects
Commit 637b58e0 authored by 13515029 - Finiko Kasula Novenda's avatar 13515029 - Finiko Kasula Novenda
Browse files
parents a1c4fc81 d5705914
Branches
No related merge requests found
...@@ -30,7 +30,7 @@ void loop() { ...@@ -30,7 +30,7 @@ void loop() {
Serial.print("Soil Moisture = "); Serial.print("Soil Moisture = ");
Serial.println(readSoil()); Serial.println(readSoil());
if (readSoil() < 900) { if (readSoil() > 60) {
Serial.println("wet soil"); Serial.println("wet soil");
digitalWrite(ledPin, LOW); digitalWrite(ledPin, LOW);
} else { } else {
...@@ -49,6 +49,6 @@ int readSoil() { ...@@ -49,6 +49,6 @@ int readSoil() {
delay(10); delay(10);
val = analogRead(soilPin); val = analogRead(soilPin);
digitalWrite(soilPower, LOW); digitalWrite(soilPower, LOW);
return val; //send current moisture value return val/1023*100; //send current moisture value
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment