Compare commits

...

2 Commits

2 changed files with 6 additions and 15 deletions

View File

@ -15,7 +15,7 @@ void setup() {
Serial.begin(19200); Serial.begin(19200);
digitalWrite(5 , HIGH); digitalWrite(5 , HIGH);
attachInterrupt(0, wakeUp, FALLING); attachInterrupt(0, wakeUp, FALLING);
Serial.println("https://git.sfs.ddnss.org/Erik/garden-watering-controller.git");
} }
@ -103,7 +103,6 @@ void wateringTheGarden() {
wait(calculatePumpOnTime() * 1000); wait(calculatePumpOnTime() * 1000);
digitalWrite(7, LOW); digitalWrite(7, LOW);
digitalWrite(9, LOW); digitalWrite(9, LOW);
} else { } else {
Serial.println("Wet enough"); Serial.println("Wet enough");
} }

View File

@ -2,10 +2,9 @@
void setup() { void setup() {
pinMode(2, INPUT); pinMode(2, INPUT);
pinMode(A4, INPUT); pinMode(A4, INPUT);
pinMode(A2, INPUT);
pinMode(A0, INPUT);
Serial.begin(19200); Serial.begin(19200);
float poty;
float dampness;
} }
@ -13,14 +12,7 @@ void loop() {
Serial.println(digitalRead(2)); Serial.println(digitalRead(2));
delay(200); delay(200);
Serial.println(analogRead(A4)); Serial.println(analogRead(A4));
Serial.println(percentage() ,4); Serial.println(analogRead(A2));
delay(20); Serial.println(analogRead(A0));
delay(1000);
} }
float percentage(){
// float poty = analogRead(A2);
//return poty/454;
return analogRead(A4) / 454;
}