Ok. So I am in the process of making an aquarium controller. The first thing I did (which was the first time I ever touched an Arduino) was make a 2 socket powerhead controller. Basically, I plug the powerheads in to the sockets, which are wired to relays, that the arduino alternates the power to for a set period of time. Example: Powerhead 1 (Plug A) on for 15 sec. while powerhead 2 (Plug B) is off for 15 sec, etc., etc.,etc. It works amazingly. Here is the code I used. I copied and pasted it then made changes as I needed, so please excuse any inaccurate description info.
// Basic 4 Realy board connection
// Each relay is turned on for 2 seconds and then off.
// You can here them click as there state changes from off to on and on to
// off.
// You will also see the corresponding Red LED on the 4 Relay board
// light up when the relay is on.
// define names for the 4 Digital pins On the Arduino 7,8,9,10
// These data pins link to 4 Relay board pins IN1, IN2, IN3, IN4
#define RELAY1 8
#define RELAY2 9
void setup()
{
// Initialise the Arduino data pins for OUTPUT
pinMode(RELAY1, OUTPUT);
pinMode(RELAY2, OUTPUT);
}
void loop()
{
digitalWrite(RELAY1,LOW); // Turns ON Relays 1
delay(15000); // Wait 2 seconds
digitalWrite(RELAY1,HIGH); // Turns Relay Off
digitalWrite(RELAY2,LOW); // Turns ON Relays 2
delay(15000); // Wait 2 seconds
digitalWrite(RELAY2,HIGH); // Turns Relay Off
}
Here is where I need help. I want to install a button to pause the above program for 10 minutes, then automatically restart. If possible, I would also like to be able to restart the program manually by pressing the button again. How would I write this code? Please keep in mind I have almost no idea what I am doing. I am trying to learn as I go, so please, don't try flexing your intellect and berate me. I'm sure this is easy, I just need some help. Thanks.