user10035: I can't use this program on my Arduino Uno since the max is 16 bits. I need my water pump to run for 5 min, then wait for 60 min.
int motorPin = A0; 
int blinkPin = 13;

int watertime = 300000; // how long to water in miliseconds
int waittime = 3600000; // how long to wait between watering

void setup() {
    pinMode(motorPin, OUTPUT);
    pinMode(blinkPin, OUTPUT);
}

void loop() {
    digitalWrite(motorPin, HIGH);
    digitalWrite(blinkPin, HIGH);
    delay(watertime);
    digitalWrite(motorPin, LOW);
    digitalWrite(blinkPin, LOW);
    delay(waittime);
}


Changed int to:
#define watertime 300000
#define waittime 3600000

But it does not work.

user4143: For any delays longer than a few seconds you really need to use a Real-Time Clock chip, like the popular DS1307 from Maxim. The Arduino's delay() function is only very roughly accurate, and even less so when used as you are using it.
If you can't get a DS1307 or something similar (there's plenty to choose from) or you Arduino has too much connected already to allow anything else to be added, you could use the Time library to simulate one.  The Time library is also useful if you do have an RTC attached.

http://playground.arduino.cc/code/time


user2881: Use the long type instead
long watertime = 300000; // how long to water in miliseconds
long waittime = 3600000; // how long to wait between watering


10035: <p>I can't use this program on my Arduino Uno since the max is 16 bits. I need my water pump to run for 5 min, then wait for 60 min.</p>

<pre><code>int motorPin = A0; 
int blinkPin = 13;

int watertime = 300000; // how long to water in miliseconds
int waittime = 3600000; // how long to wait between watering

void setup() {
    pinMode(motorPin, OUTPUT);
    pinMode(blinkPin, OUTPUT);
}

void loop() {
    digitalWrite(motorPin, HIGH);
    digitalWrite(blinkPin, HIGH);
    delay(watertime);
    digitalWrite(motorPin, LOW);
    digitalWrite(blinkPin, LOW);
    delay(waittime);
}
</code></pre>

<hr>

<p>Changed int to:</p>

<pre><code>#define watertime 300000
#define waittime 3600000
</code></pre>

<p>But it does not work.</p>
 4143: <p>For any delays longer than a few seconds you really need to use a Real-Time Clock chip, like the popular DS1307 from Maxim. The Arduino's delay() function is only very roughly accurate, and even less so when used as you are using it.</p>

<p>If you can't get a DS1307 or something similar (there's plenty to choose from) or you Arduino has too much connected already to allow anything else to be added, you could use the <code>Time</code> library to simulate one.  The <code>Time</code> library is also useful if you do have an RTC attached.</p>

<ul>
<li><a href="http://playground.arduino.cc/code/time" rel="nofollow">http://playground.arduino.cc/code/time</a></li>
</ul>
 2881: <p>Use the <code>long</code> type instead</p>

<pre><code>long watertime = 300000; // how long to water in miliseconds
long waittime = 3600000; // how long to wait between watering
</code></pre>
