I am a very neewbe but i have a small project to automatic wather the plants home.
i am not sure what is going on but i need some help to finish it
I am very sorry for my poor english but i hope some one can help me.
if (sValue1 + sValue2 + sValue3 + sValue4 / 4 <= 400) {
digitalWrite(pump, HIGH)
Serial.print("The plant need some wather, it will now be started")
Wait 5
digitalWrite(pump, low)
delay 21600
}
Else
digitalWrite(pump, low)
Serial.print("The Plant dont need wather right now")
Thank you for the code, i have done some testing with it.
i have removed on of the sensors so it will have 3 not 4.
But there is an error in the code that i don't quite understand.
// AUTHOR: Rob Tillaart
// VERSION: 0.1
// PURPOSE: waterpump
// DATE: 2014-03-30
// URL:
//
// Released to the public domain
//
const int Soil1 = A0;
const int Soil2 = A1;
const int Soil3 = A2;
const int waterPump = 3;
const int DRY = 400;
void setup()
{
Serial.begin (9600);
Serial.println("Waterpump 0.1");
pinMode(waterPump, OUTPUT);
digitalWrite(waterPump, LOW); // state off
Serial.println("Test waterpump at start");
giveWater(1);
}
void loop()
{
int hum1 = analogRead(Soil1);
int hum2 = analogRead(Soil2);
int hum3 = analogRead(Soil3);
int averageHumidity = (hum1 + hum2 + hum3) / 3;
if ( isDry(averageHumidity) )
{
Serial.print(millis / 1000); // timestamp
Serial.println("\tThe plant need some water, it will now be started");
giveWater(5);
}
}
void giveWater(int seconds)
{
digitalWrite(waterPump, HIGH);
delay(seconds * 1000L);
digitalWrite(waterPump, LOW);
}
It is the part : if ( isDry(averageHumidity) )
Error:
sketch_may01a.ino: In function 'void loop()':
sketch_may01a:36: error: 'isDry' was not declared in this scope
sketch_may01a:38: error: invalid operands of types 'long unsigned int ()()' and 'int' to binary 'operator/'