I know I should probably understand more then I do before I even ask, but just in case there is someone out there that is interested.
I am trying to turn my relay switch off and on at set times like 8AM to 9PM but im not sure how to even go about doing that, ive seen some tutorials for clocks etc, but I havnt found one that works for me yet... Maybe im getting in over my head but any help would be appreciated... All I understand how to use is delay but thats not doing what I want it to do.
Forgive me for my newbness...
int relay1 = 1;
int relay2 = 2;
int relay3 = 3;
int relay4 = 4;
void setup()
{
pinMode(1, OUTPUT); //Set Pin1 as output
digitalWrite(1, HIGH); //Set Pin1 High, keeps off relay until low signal recieved
pinMode(2, OUTPUT); //Set Pin2 as output
digitalWrite(2, HIGH); //Set Pin2 High, keeps off relay until low signal recieved
pinMode(3, OUTPUT); //Set Pin3 as output
digitalWrite(3, HIGH); //Set Pin3 High, keeps off relay until low signal recieved
pinMode(4, OUTPUT); //Set Pin4 as output
digitalWrite(4, HIGH); //Set Pin4 High, keeps off relay until low signal recieved
}
void loop()
{
digitalWrite(relay1, HIGH); //Turn off relay
delay(2000);
digitalWrite(relay1, LOW); //Turn on relay
delay(2000);
}
I am trying to automate my aquariums lighting in case anyone is wondering what this is for...
Anyways thanks for reading...