On the occasion of the Christmas festivities, we will explore how to create a tree-top star made of LEDs using the Arduino platform. This project, both aesthetic and creative, will make an ideal light-up decoration to enhance your Christmas tree.

Caution: It can be dangerous to use electricity near your Christmas tree. Arduino Factory will not be held responsible for any incident resulting from this project.

Here is the model of the Christmas star we aim to create:

To light up the LEDs of your Christmas star, it will be necessary to program your Arduino board. For this purpose, you can use the Arduino IDE development environment and the following code:

int RED = 11;
int GREEN = 12;
void setup() {                
  pinMode(RED, OUTPUT);
  pinMode(GREEN, OUTPUT);
 
}

void loop() {
  
   digitalWrite(RED, 0); //r
    digitalWrite(GREEN, 0);//g
  delay(1000);
  
    digitalWrite(RED, 255); //r
  digitalWrite(GREEN, 0);
  delay(1000);
    digitalWrite(RED, 0); //g
  digitalWrite(GREEN, 255);
  delay(1000);
  
  digitalWrite(GREEN, 0);

  delay(500);
    
  digitalWrite(RED, 255); //r
  digitalWrite(GREEN, 0);
  delay(200);
    digitalWrite(RED, 0); //g
  digitalWrite(GREEN, 255);
  delay(200);
      digitalWrite(RED, 255); //r
  digitalWrite(GREEN, 0);
  delay(200);
    digitalWrite(RED, 0); //g
  digitalWrite(GREEN, 255);
  delay(200);
      digitalWrite(RED, 255); //r
  digitalWrite(GREEN, 0);
  delay(200);
    digitalWrite(RED, 0); //g
  digitalWrite(GREEN, 255);
  delay(200);
  digitalWrite(GREEN, 0);
}