turning on a relay for one minute. turning it back off for five minutes then bac

I keep reading that I cant run delays for this length of time. I want to turn a relay on for one minute then off for five minutes and do this 3500 times in a row.

I keep reading that I cant run delays for this length of time

I suggest you change your reading material.

Very helpful
Thanks

I don't know the upper limit to delay() but wouldn't expect any problems with delay(60000) or delay(300000). Not the best coding practice, though, but it'll get the job done. Add a for loop to run it 3,500 times and you're settled for the next 15 days.

Have a look at how millis() is used to manage timing without blocking in Several things at a time

Just substitute your relay for one of the LEDs and change the timing to suit. And period up to about 49 days is feasible.

...R

I figured i'd try something easy to start with like an even amount of high and low time so I checked it with the LED pin. I can get 30 second at a time on then off but not a minute.

sketch_jun13a.ino (351 Bytes)

I can get 30 second

without downloading your code, I'm going to guess you can get 32.767 seconds

glennputman:
Very helpful
Thanks

You're very welcome

If you declare waitTime as long or unsigned long and not as an int, you will be able to it to work over a longer time period.