Timed Solenoid

I’ve been using a bit of code from a colleague for irrigation. It uses an Arduino mega to control 16 solenoids through a 16 relay board, then logs everything through a data logging shield. Right now there’s moisture sensors plugged into the arduino and when the moisture level gets below a certain threshold, the solenoids go off and the plants get watered. What I’m wanting to do is set one of the relays to a timer instead of moisure threshold so I can use that solenoid for fertilizer (ie fertilize once every 12 hours).

Edit- Originally I worded this poorly. I’ve been using arduino for awhile, but this is a bit more complex than what I’m used to.

megairrigation1.ino (20.2 KB)

jcan:
I've been using a bit of code for irrigation. It uses an Arduino mega to control 16 solenoids through a 16 relay board. Right now there's moisture sensors plugged into the arduino and when the moisture level gets below a certain threshold, the solenoids go off and the plants get watered. What I'm wanting to do is set on of the relays to a timer instead of moisure threshold so I can use that solenoid for fertilizer (ie fertilize once every 12 hours). I've been using arduino for a while and know I should probably use something like blinkwithoutndelay, but I'm not sure how to shoe horn it into the code. Any help would be greatly appreciated.

No point in looking at your code if you are not already using blink without using delay. You will be able to use what you learned from your original program, but the way of thinking about your project will have to change, and then you begin.

Paul