Instructables

3 Channel arduino Powered Christmas Light Controller!

Featured

Step 4: Program the Arduino

The following code will cycle through turning on each relay:

void setup() {

pinMode(13,OUTPUT);
pinMode(12,OUPTUT);
pinMode(11,OUTPUT);
}

void loop() {

digitalWrite(13,HIGH);
delay(900);
digitalWrite(13,LOW);
delay(900);
digitalWrite(12,HIGH);
delay(900);
digitalWrite(12,LOW);
delay(900);
digitalWrite(11,HIGH);
delay(900);
digitalWrite(11,LOW);
delay(900);
}
 
Remove these adsRemove these ads by Signing Up
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!