Guiye Perez Bongiovanni
Published © GPL3+

Two Led Codes - Christmas CyberTree USB Arduino

Built with recycled elements, high brightness color LEDs and an RGB LED. Arduino Mega 2560

BeginnerShowcase (no instructions)3,102
Two Led Codes - Christmas CyberTree USB Arduino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
High Brightness LED, Color
×8
LED, RGB
LED, RGB
×1
Aluminum dissipator
×3
Hard disk reading head
×1
Glass Ball
×2
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Breadboard (generic)
Breadboard (generic)
×1
5V Power bank
×1

Story

Read more

Schematics

conexion_PhRgaXx5kW.png

Code

CyberTree 2021

Arduino
New Led Code
/*
  Parpadeo de 8 LEDs
  Secuencias de parpadeos de 8 LEDs + LED RGB
 */


//Declaracion de los pines como constantes:
const int LEDr=44; //Color rojo pin 9
const int LEDg=45; //Color verde pin 10
const int LEDb=46; //Color azul pin 11
//Declaracin de las variables necesarias:

int rojo=0;
int verde=0;
int azul=0;


int R = 2;         // Pin digital al que conectamos el LED rojo
int Y = 3;         // Pin digital al que conectamos el LED amarillo
int B = 4;         // Pin digital al que conectamos el LED azul
int W = 5;         // Pin digital al que conectamos el LED blanco
int B2 = 6;        // Pin digital al que conectamos el LED azul 2
int Y2 = 7;        // Pin digital al que conectamos el LED amarillo 2
int R2 = 8;        // Pin digital al que conectamos el LED rojo 2
int W2 = 12;       // Pin digital al que conectamos el LED blanco 2

///

///

void setup() {               
  pinMode(R, OUTPUT);    // Configracin del pin 2 como salida
  pinMode(Y, OUTPUT);    // Configracin del pin 3 como salida
  pinMode(B, OUTPUT);    // Configracin del pin 4 como salida
  pinMode(W, OUTPUT);    // Configracin del pin 5 como salida
  pinMode(B2, OUTPUT);   // Configracin del pin 6 como salida
  pinMode(Y2, OUTPUT);   // Configracin del pin 7 como salida
  pinMode(R2, OUTPUT);   // Configracin del pin 8 como salida
  pinMode(W2, OUTPUT);   // Configracin del pin 12 como salida

  //Comprobacion de cada color por separado
  setColor(0,255,255);
  delay(5);
  setColor(255,0,255);
  delay(5);
  setColor(255,255,0);
  delay(5);
  
  //Comprobacion todos los colores
  setColor(255,255,255);
  delay(5);
  setColor(0,0,0);
  delay(5);
  setColor(255,255,255);
  delay(5);
  //Dejamos el color rojo para empezar el loop
  setColor(0,255,255);
  delay(5);
  } 

void loop() 

{

 
  

 
 //Se mantiene el rojo al maximo mientras sube el verde
  for (int verde=255;verde>=0;verde--){
    setColor(0,verde,255);
    delay(3);
    } 
  //Se mantiene el verde al maximo mientras baja el rojo
  for (int rojo=0;rojo<=255;rojo++){
    setColor(rojo,0,255);
    delay(3);
    }

      //Se mantiene el verde al maximo mientras baja el rojo
  for (int rojo=0;rojo<=255;rojo++){
    setColor(rojo,0,255);
    delay(3);
    }
    
      ///RED
      {setColor(255,0,0);
      delay(10);
      setColor(0,0,0);
      delay(10);
      
      ///GREEN
      setColor(0,255,0);
      delay(10);
      setColor(0,0,0);
      delay(10);
      
      ///BLUE
      setColor(0,0,255);
      delay(10);
      setColor(0,0,0);
      delay(10);


    } 



  
/////////////

 digitalWrite(R, HIGH);  
  delay(20);                
  digitalWrite(Y, HIGH); 
  delay(20);                  
  digitalWrite(B, HIGH);  
  delay(20);                  
  digitalWrite(W, HIGH);  
  delay(20);                  
  digitalWrite(B2, HIGH); 
  delay(20);                   
  digitalWrite(Y2, HIGH);  
  delay(20);                 
  digitalWrite(R2, HIGH);  
  delay(20);                 

  digitalWrite(R, LOW);  
  delay(20);                  
  digitalWrite(Y, LOW);  
  delay(21);                
  digitalWrite(B, LOW); 
  delay(22);               
  digitalWrite(W, LOW);  
  delay(23);                 
  digitalWrite(B2, LOW);  
  delay(24);                  
  digitalWrite(Y2, LOW);  
  delay(25);                 
  digitalWrite(R2, LOW);  
  delay(26);                  

////destello blanco////

  digitalWrite(W2, HIGH);  
  delay(5);  
  digitalWrite(W2, LOW);  
  delay(10); 
  digitalWrite(R2, HIGH);  
  delay(5);  
  digitalWrite(R2, LOW);  
  delay(10); 
  digitalWrite(B2, HIGH);  
  delay(5);  
  digitalWrite(B2, LOW);  
  delay(10); 
  
/////////////


 setColor(100,100,100);
  delay(500);

  
    //////

 digitalWrite(R, HIGH); 
  delay(10);                  
  digitalWrite(R, LOW); 
  delay(10);                  
  
  digitalWrite(Y, HIGH);  
  delay(10);                 
  digitalWrite(Y, LOW);  
  delay(10);                 
  
  digitalWrite(B, HIGH);  
  delay(10);                  
  digitalWrite(B, LOW);  
  delay(10);                  
  
  digitalWrite(W, HIGH); 
  delay(10);                  
  digitalWrite(W, LOW); 
  delay(10);                  
  
  digitalWrite(B2, HIGH);  
  delay(10);                  
  digitalWrite(B2, LOW);  
  delay(10);                  
  
  digitalWrite(Y2, HIGH);  
  delay(10);                  
  digitalWrite(Y2, LOW);  
  delay(10);                  
  
  digitalWrite(R2, HIGH);  
  delay(10);                  
  digitalWrite(R2, LOW); 
  delay(10);  


  
  /////

  digitalWrite(R, HIGH); 
  delay(10);                  
  digitalWrite(R, LOW); 
  delay(10);                  
  
  digitalWrite(Y, HIGH);  
  delay(10);                 
  digitalWrite(Y, LOW);  
  delay(10);                 
  
  digitalWrite(B, HIGH);  
  delay(10);                  
  digitalWrite(B, LOW);  
  delay(10);                  
  
  digitalWrite(W, HIGH); 
  delay(10);                  
  digitalWrite(W, LOW); 
  delay(10);                  
  
  digitalWrite(B2, HIGH);  
  delay(10);                  
  digitalWrite(B2, LOW);  
  delay(10);                  
  
  digitalWrite(Y2, HIGH);  
  delay(10);                  
  digitalWrite(Y2, LOW);  
  delay(10);                  
  
  digitalWrite(R2, HIGH);  
  delay(10);                  
  digitalWrite(R2, LOW); 
  delay(10);  

  
  /////

 setColor(255,255,100);
  delay(500);

  
/////////////

  digitalWrite(R, HIGH);  
  delay(7);                
  digitalWrite(Y, HIGH); 
  delay(7);                  
  digitalWrite(B, HIGH);  
  delay(7);                  
  digitalWrite(W, HIGH);  
  delay(7);                  
  digitalWrite(B2, HIGH); 
  delay(7);                   
  digitalWrite(Y2, HIGH);  
  delay(7);                 
  digitalWrite(R2, HIGH);  
  delay(7);    
  digitalWrite(W2, HIGH);  
  delay(7); 
//
  digitalWrite(R, LOW);  
  delay(7);                  
  digitalWrite(Y, LOW);  
  delay(7);                
  digitalWrite(B, LOW); 
  delay(7);               
  digitalWrite(W, LOW);  
  delay(7);                 
  digitalWrite(B2, LOW);  
  delay(7);                  
  digitalWrite(Y2, LOW);  
  delay(7);                 
  digitalWrite(R2, LOW);  
  delay(7);  
  digitalWrite(W2, LOW);  
  delay(7);

////


    //////
  
  digitalWrite(R, HIGH); 
  delay(7);                  
  digitalWrite(R, LOW); 
  delay(7);                  
  
  digitalWrite(Y, HIGH);  
  delay(7);                 
  digitalWrite(Y, LOW);  
  delay(7);                 
  
  digitalWrite(B, HIGH);  
  delay(7);                  
  digitalWrite(B, LOW);  
  delay(7);                  
  
  digitalWrite(W, HIGH); 
  delay(7);                  
  digitalWrite(W, LOW); 
  delay(7);                  
  
  digitalWrite(B2, HIGH);  
  delay(7);                  
  digitalWrite(B2, LOW);  
  delay(7);                  
  
  digitalWrite(Y2, HIGH);  
  delay(7);                  
  digitalWrite(Y2, LOW);  
  delay(7);                  
  
  digitalWrite(R2, HIGH);  
  delay(7);                  
  digitalWrite(R2, LOW); 
  delay(7);                  



  setColor(0,0,255);
  delay(500);

    
    ////
 
  digitalWrite(R, HIGH); 
  delay(20);                  
  digitalWrite(R, LOW); 
  delay(7);                  
  
  digitalWrite(Y, HIGH);  
  delay(20);                 
  digitalWrite(Y, LOW);  
  delay(7);                 
  
  digitalWrite(B, HIGH);  
  delay(20);                  
  digitalWrite(B, LOW);  
  delay(7);                  
  
  digitalWrite(W, HIGH); 
  delay(20);                  
  digitalWrite(W, LOW); 
  delay(7);                  
  
  digitalWrite(B2, HIGH);  
  delay(20);                  
  digitalWrite(B2, LOW);  
  delay(7);                  
  
  digitalWrite(Y2, HIGH);  
  delay(20);                  
  digitalWrite(Y2, LOW);  
  delay(7);                  
  
  digitalWrite(R2, HIGH);  
  delay(20);                  
  digitalWrite(R2, LOW); 
  delay(7); 



/////////////

  digitalWrite(R, HIGH); 
  delay(20);                  
  digitalWrite(R, LOW); 
  delay(20);                  
  
  digitalWrite(Y, HIGH);  
  delay(20);                 
  digitalWrite(Y, LOW);  
  delay(20);                 
  
  digitalWrite(B, HIGH);  
  delay(20);                  
  digitalWrite(B, LOW);  
  delay(20);                  
  
  digitalWrite(W, HIGH); 
  delay(20);                  
  digitalWrite(W, LOW); 
  delay(20);                  
  
  digitalWrite(B2, HIGH);  
  delay(20);                  
  digitalWrite(B2, LOW);  
  delay(20);                  
  
  digitalWrite(Y2, HIGH);  
  delay(20);                  
  digitalWrite(Y2, LOW);  
  delay(20);                  
  
  digitalWrite(R2, HIGH);  
  delay(20);                  
  digitalWrite(R2, LOW); 
  delay(20);               

//////////


  setColor(55,55,255);
  delay(500);

   
/////////////

  digitalWrite(R, HIGH);  
  delay(50);                 
  
  digitalWrite(R2, HIGH); 
  delay(50); 
 
  digitalWrite(Y, HIGH); 
  delay(50);                 

  digitalWrite(Y2, HIGH);  
  delay(50);                 
  
  digitalWrite(B, HIGH);  
  delay(50);                 
 
  digitalWrite(B2, HIGH); 
  delay(50);                   
  
  digitalWrite(W, HIGH);  
  delay(50);                  
 

  digitalWrite(R, LOW);  
  delay(5);                 

  digitalWrite(R2, LOW);  
  delay(5);    

  digitalWrite(Y, LOW);  
  delay(7);                  

  digitalWrite(Y2, LOW);  
  delay(7);  

  digitalWrite(B, LOW);  
  delay(10);                
  
  digitalWrite(B2, LOW); 
  delay(15);                

  digitalWrite(W, LOW);  
  delay(20);

///////////////////////////

  digitalWrite(R, HIGH);  
  digitalWrite(R2, HIGH); 
  delay(20); 
 
  digitalWrite(Y, HIGH); 
  digitalWrite(Y2, HIGH);  
  delay(20);                 
  
  digitalWrite(B, HIGH);  
  digitalWrite(B2, HIGH); 
  delay(20);                   
  
  digitalWrite(W, HIGH);  
  delay(20);                  
 
  digitalWrite(R, LOW);  
  digitalWrite(R2, LOW);  
  delay(7);    

  digitalWrite(Y, LOW);  
  digitalWrite(Y2, LOW);  
  delay(7);  

  digitalWrite(B, LOW);  
  digitalWrite(B2, LOW); 
  delay(7);                

  digitalWrite(W, LOW);  
  delay(7);   

///////

  setColor(0,100,100);
  delay(500);

    //////DESTELLO BLANCO/////

  digitalWrite(R2, HIGH);  
  delay(50);  
  digitalWrite(R2, LOW);  
  delay(50); 
  digitalWrite(W2, HIGH);  
  delay(50);  
  digitalWrite(W2, LOW);  
  delay(50); 
  digitalWrite(B2, HIGH);  
  delay(50);  
  digitalWrite(B2, LOW);  
  delay(50); 

  digitalWrite(W, HIGH);  
  delay(50);  
  digitalWrite(W, LOW);  
  delay(50);  
  digitalWrite(W2, HIGH);  
  delay(50);  
  digitalWrite(W2, LOW);  
  delay(50);  
  digitalWrite(B, HIGH);  
  delay(50);  
  digitalWrite(B, LOW);  
  delay(50);  

  digitalWrite(W2, HIGH);  
  delay(50);  
  digitalWrite(W2, LOW);  
  delay(50); 
  digitalWrite(Y2, HIGH);  
  delay(50);  
  digitalWrite(Y2, LOW);  
  delay(50); 
  digitalWrite(W2, HIGH);  
  delay(50);  
  digitalWrite(W2, LOW);  
  delay(50); 

  digitalWrite(Y2, HIGH);  
  delay(50);  
  digitalWrite(Y2, LOW);  
  delay(50);  
  digitalWrite(B, HIGH);  
  delay(50);  
  digitalWrite(B, LOW);  
  digitalWrite(W2, HIGH);  
  delay(50);  
  digitalWrite(W2, LOW);  
  delay(50); 
  delay(50);  
  digitalWrite(B2, HIGH);  
  delay(50);  
  digitalWrite(B2, LOW);  
  delay(50);  

//

 
 setColor(230,40,230);
  delay(500); 

  
///////////////////////////
///////////////////////////
  //////DESTELLO VARIADO/////

  digitalWrite(R2, HIGH);  
  delay(50);  
  digitalWrite(R2, LOW);  
  delay(50); 
  digitalWrite(R2, HIGH);  
  delay(50);  
  digitalWrite(R2, LOW);  
  delay(50); 
  digitalWrite(Y2, HIGH);  
  delay(50);  
  digitalWrite(Y2, LOW);  
  delay(50); 

  digitalWrite(W2, HIGH);  
  delay(50);  
  digitalWrite(W2, LOW);  
  delay(50);  
  digitalWrite(W, HIGH);  
  delay(50);  
  digitalWrite(W, LOW);  
  delay(50);  
  digitalWrite(Y, HIGH);  
  delay(50);  
  digitalWrite(Y, LOW);  
  delay(50);  

  digitalWrite(R2, HIGH);  
  delay(50);  
  digitalWrite(R2, LOW);  
  delay(50); 
  digitalWrite(Y2, HIGH);  
  delay(50);  
  digitalWrite(Y2, LOW);  
  delay(50); 
  digitalWrite(R2, HIGH);  
  delay(50);  
  digitalWrite(R2, LOW);  
  delay(50); 

  digitalWrite(B, HIGH);  
  delay(50);  
  digitalWrite(B, LOW);  
  delay(50);  
  digitalWrite(B2, HIGH);  
  delay(50);  
  digitalWrite(B2, LOW);  
  delay(50);  
  digitalWrite(B, HIGH);  
  delay(50);  
  digitalWrite(B, LOW);  
  delay(50);  

//

  digitalWrite(R, HIGH);  
  delay(50);  
  digitalWrite(R, LOW);  
  delay(50); 
  digitalWrite(Y2, HIGH);  
  delay(50);  
  digitalWrite(Y2, LOW);  
  delay(50); 
  digitalWrite(W, HIGH);  
  delay(50);  
  digitalWrite(W, LOW);  
  delay(50); 
  digitalWrite(Y, HIGH);  
  delay(50);  
  digitalWrite(Y, LOW);  
  delay(50); 
  digitalWrite(R2, HIGH);  
  delay(50);  
  digitalWrite(R2, LOW);  
  delay(50); 
  digitalWrite(W2, HIGH);  
  delay(50);  
  digitalWrite(W2, LOW);  
  delay(50); 
  digitalWrite(Y2, HIGH);  
  delay(50);  
  digitalWrite(Y2, LOW);  
  delay(50); 
  digitalWrite(R2, HIGH);  
  delay(50);  
  digitalWrite(R2, LOW);  
  delay(50); 
  digitalWrite(W, HIGH);  
  delay(50);  
  digitalWrite(W, LOW);  
  delay(50); 
  digitalWrite(Y, HIGH);  
  delay(50);  
  digitalWrite(Y, LOW);  
  delay(50); 
  digitalWrite(R2, HIGH);  
  delay(50);  
  digitalWrite(R2, LOW);  
  delay(50); 
  digitalWrite(Y2, HIGH);  
  delay(50);  
  digitalWrite(Y2, LOW);  
  delay(50); 
  digitalWrite(W2, HIGH);  
  delay(50);  
  digitalWrite(W2, LOW);  
  delay(50); 
  digitalWrite(Y, HIGH);  
  delay(50);  
  digitalWrite(Y, LOW);  
  delay(50); 
  digitalWrite(R2, HIGH);  
  delay(50);  
  digitalWrite(R2, LOW);  
  delay(50); 
  digitalWrite(W, HIGH);  
  delay(50);  
  digitalWrite(W, LOW);  
  delay(50); 
  digitalWrite(Y2, HIGH);  
  delay(50);  
  digitalWrite(Y2, LOW);  
  delay(50); 
  digitalWrite(R2, HIGH);  
  delay(50);  
  digitalWrite(R2, LOW);  
  delay(50); 
  digitalWrite(W2, HIGH);  
  delay(50);  
  digitalWrite(W2, LOW);  
  delay(50); 

///////////////////////////
///////////////////////////


 setColor(0,255,30);
  delay(500);
 
///////////////////////////
{
  ///raya/////////////////
 
  digitalWrite(W, HIGH);   
  digitalWrite(Y, HIGH);  
  digitalWrite(Y2, HIGH);
  digitalWrite(B, HIGH);   
  digitalWrite(B2, HIGH);  
  digitalWrite(R, HIGH);
  digitalWrite(R2, HIGH);   
  delay(50); 
  
  digitalWrite(W, LOW);   
  digitalWrite(Y, LOW);  
  digitalWrite(Y2, LOW);
  digitalWrite(B, LOW);   
  digitalWrite(B2, LOW);  
  digitalWrite(R, LOW);
  digitalWrite(R2, LOW);   
  delay(20);         

  digitalWrite(W, HIGH);   
  digitalWrite(Y, HIGH);  
  digitalWrite(Y2, HIGH);
  digitalWrite(B, HIGH);   
  digitalWrite(B2, HIGH);  
  digitalWrite(R, HIGH);
  digitalWrite(R2, HIGH);   
  delay(50); 
  
  digitalWrite(W, LOW);   
  digitalWrite(Y, LOW);  
  digitalWrite(Y2, LOW);
  digitalWrite(B, LOW);   
  digitalWrite(B2, LOW);  
  digitalWrite(R, LOW);
  digitalWrite(R2, LOW);   
  delay(20);   

}

////punto//////////////////

  digitalWrite(W, HIGH);   
  digitalWrite(Y, HIGH);  
  digitalWrite(Y2, HIGH);
  digitalWrite(B, HIGH);   
  digitalWrite(B2, HIGH);  
  digitalWrite(R, HIGH);
  digitalWrite(R2, HIGH);   
  delay(50); 
  
  digitalWrite(W, LOW);   
  digitalWrite(Y, LOW);  
  digitalWrite(Y2, LOW);
  digitalWrite(B, LOW);   
  digitalWrite(B2, LOW);  
  digitalWrite(R, LOW);
  digitalWrite(R2, LOW);   
  delay(20);   

  digitalWrite(W, HIGH);   
  digitalWrite(Y, HIGH);  
  digitalWrite(Y2, HIGH);
  digitalWrite(B, HIGH);   
  digitalWrite(B2, HIGH);  
  digitalWrite(R, HIGH);
  digitalWrite(R2, HIGH);   
  delay(50); 
  
  digitalWrite(W, LOW);   
  digitalWrite(Y, LOW);  
  digitalWrite(Y2, LOW);
  digitalWrite(B, LOW);   
  digitalWrite(B2, LOW);  
  digitalWrite(R, LOW);
  digitalWrite(R2, LOW);   
  delay(20); 

////////////////////////////

  digitalWrite(R, HIGH); 
  delay(70);                 
  digitalWrite(Y, HIGH);  
  delay(65);                 
  digitalWrite(B, HIGH); 
  delay(60);                 
  digitalWrite(W, HIGH);  
  delay(55);                 
  digitalWrite(Y2, HIGH); 
  delay(50);                  
  digitalWrite(B2, HIGH);  
  delay(45);                 
  digitalWrite(R2, HIGH);  
  delay(40);     

  digitalWrite(W2, HIGH);  
  delay(100);    

  digitalWrite(R, LOW);  
  delay(40);                  
  digitalWrite(Y, LOW);  
  delay(45);                
  digitalWrite(B, LOW);  
  delay(50);                 
  digitalWrite(W, LOW);  
  delay(55);                 
  digitalWrite(B2, LOW);  
  delay(60);                
  digitalWrite(Y2, LOW); 
  delay(65);                 
  digitalWrite(R2, LOW);  
  delay(70);

  digitalWrite(W2, LOW);  
  delay(100);  
  
 ///////////////////////////

 digitalWrite(R, HIGH); 
  delay(70);                 
  digitalWrite(Y, HIGH);  
  delay(65);                 
  digitalWrite(B, HIGH); 
  delay(60);                 
  digitalWrite(W, HIGH);  
  delay(55);                 
  digitalWrite(Y2, HIGH); 
  delay(50);                  
  digitalWrite(B2, HIGH);  
  delay(45);                 
  digitalWrite(R2, HIGH);  
  delay(40);     

  digitalWrite(W2, HIGH);  
  delay(10);    

  digitalWrite(R, LOW);  
  delay(40);                  
  digitalWrite(Y, LOW);  
  delay(45);                
  digitalWrite(B, LOW);  
  delay(50);                 
  digitalWrite(W, LOW);  
  delay(55);                 
  digitalWrite(B2, LOW);  
  delay(60);                
  digitalWrite(Y2, LOW); 
  delay(65);                 
  digitalWrite(R2, LOW);  
  delay(70);

  digitalWrite(W2, LOW);  
  delay(100);  
  
///////////////////////////
   
 setColor(0,50,20);
  delay(500);
  

  ////////
  ///////
  //////
  

    


/////
/////
/////
  digitalWrite(Y, HIGH);  
  delay(35);  
  digitalWrite(Y, LOW);  
  delay(35); 
  digitalWrite(R, HIGH);  
  delay(35);  
  digitalWrite(R, LOW);  
  delay(35); 
  digitalWrite(Y, HIGH);  
  delay(35);  
  digitalWrite(Y, LOW);  
  delay(35); 
  digitalWrite(R, HIGH);  
  delay(35);  
  digitalWrite(R, LOW);  
  delay(35); 
  digitalWrite(Y, HIGH);  
  delay(35);  
  digitalWrite(Y, LOW);  
  delay(35); 
  digitalWrite(R, HIGH);  
  delay(35);  
  digitalWrite(R, LOW);  
  delay(35); 
  digitalWrite(Y, HIGH);  
  delay(35);  
  digitalWrite(Y, LOW);  
  delay(35); 
  digitalWrite(R, HIGH);  
  delay(35);  


 setColor(0,0,0);
  delay(500);
    
/////
/////
/////
  digitalWrite(B, HIGH);  
  delay(35);  
  digitalWrite(B, LOW);  
  delay(35); 
  digitalWrite(Y, HIGH);  
  delay(35);  
  digitalWrite(Y, LOW);  
  delay(35); 
  digitalWrite(B, HIGH);  
  delay(35);  
  digitalWrite(B, LOW);  
  delay(35); 
  digitalWrite(Y, HIGH);  
  delay(35);  
  digitalWrite(Y, LOW);  
  delay(35); 
  digitalWrite(B, HIGH);  
  delay(35);  
  digitalWrite(B, LOW);  
  delay(35); 
  digitalWrite(Y, HIGH);  
  delay(35);  
  digitalWrite(Y, LOW);  
  delay(35); 
  digitalWrite(B, HIGH);  
  delay(35);  
  digitalWrite(B, LOW);  
  delay(35); 
  digitalWrite(Y, HIGH);  
  delay(35);  
 

   
    
/////
/////
/////
  digitalWrite(W, HIGH);  
  delay(35);  
  digitalWrite(W, LOW);  
  delay(35); 
  digitalWrite(B, HIGH);  
  delay(35);  
  digitalWrite(B, LOW);  
  delay(35); 
  digitalWrite(W, HIGH);  
  delay(35);  
  digitalWrite(W, LOW);  
  delay(35); 
  digitalWrite(B, HIGH);  
  delay(35);  
  digitalWrite(B, LOW);  
  delay(35); 
  digitalWrite(W, HIGH);  
  delay(35);  
  digitalWrite(W, LOW);  
  delay(35); 
  digitalWrite(B, HIGH);  
  delay(35);  
  digitalWrite(B, LOW);  
  delay(35); 
  digitalWrite(W, HIGH);  
  delay(35);  
  digitalWrite(W, LOW);  
  delay(35); 
  digitalWrite(B, HIGH);  
  delay(35);  


 
/////
/////
/////
  digitalWrite(B2, HIGH);  
  delay(35);  
  digitalWrite(B2, LOW);  
  delay(35); 
  digitalWrite(W, HIGH);  
  delay(35);  
  digitalWrite(W, LOW);  
  delay(35); 
  digitalWrite(B2, HIGH);  
  delay(35);  
  digitalWrite(B2, LOW);  
  delay(35); 
  digitalWrite(W, HIGH);  
  delay(35);  
  digitalWrite(W, LOW);  
  delay(35); 
  digitalWrite(B2, HIGH);  
  delay(35);  
  digitalWrite(B2, LOW);  
  delay(35); 
  digitalWrite(W, HIGH);  
  delay(35);  
  digitalWrite(W, LOW);  
  delay(35); 
  digitalWrite(B2, HIGH);  
  delay(35);  
  digitalWrite(B2, LOW);  
  delay(35); 
  digitalWrite(W, HIGH);  
  delay(35);  
 
/////
/////
/////
  digitalWrite(Y2, HIGH);  
  delay(35);  
  digitalWrite(Y2, LOW);  
  delay(35); 
  digitalWrite(B2, HIGH);  
  delay(35);  
  digitalWrite(B2, LOW);  
  delay(35); 
  digitalWrite(Y2, HIGH);  
  delay(35);  
  digitalWrite(Y2, LOW);  
  delay(35); 
  digitalWrite(B2, HIGH);  
  delay(35);  
  digitalWrite(B2, LOW);  
  delay(35); 
  digitalWrite(Y2, HIGH);  
  delay(35);  
  digitalWrite(Y2, LOW);  
  delay(35); 
  digitalWrite(B2, HIGH);  
  delay(35);  
  digitalWrite(B2, LOW);  
  delay(35); 
  digitalWrite(Y2, HIGH);  
  delay(35);  
  digitalWrite(Y2, LOW);  
  delay(35); 
  digitalWrite(B2, HIGH);  
  delay(35);  
 

/////
/////
/////
  digitalWrite(R2, HIGH);  
  delay(35);  
  digitalWrite(R2, LOW);  
  delay(35); 
  digitalWrite(Y2, HIGH);  
  delay(35);  
  digitalWrite(Y2, LOW);  
  delay(35); 
  digitalWrite(R2, HIGH);  
  delay(35);  
  digitalWrite(R2, LOW);  
  delay(35); 
  digitalWrite(Y2, HIGH);  
  delay(35);  
  digitalWrite(Y2, LOW);  
  delay(35); 
  digitalWrite(R2, HIGH);  
  delay(35);  
  digitalWrite(R2, LOW);  
  delay(35); 
  digitalWrite(Y2, HIGH);  
  delay(35);  
  digitalWrite(Y2, LOW);  
  delay(35); 
  digitalWrite(R2, HIGH);  
  delay(35);  
  digitalWrite(R2, LOW);  
  delay(35); 
  digitalWrite(Y2, HIGH);  
  delay(35);  
 


/////
/////
/////
  digitalWrite(W2, HIGH);  
  delay(35);  
  digitalWrite(W2, LOW);  
  delay(35); 
  digitalWrite(R2, HIGH);  
  delay(35);  
  digitalWrite(R2, LOW);  
  delay(35); 
  digitalWrite(W2, HIGH);  
  delay(35);  
  digitalWrite(W2, LOW);  
  delay(35); 
  digitalWrite(R2, HIGH);  
  delay(35);  
  digitalWrite(R2, LOW);  
  delay(35); 
  digitalWrite(W2, HIGH);  
  delay(35);  
  digitalWrite(W2, LOW);  
  delay(35); 
  digitalWrite(R2, HIGH);  
  delay(35);  
  digitalWrite(R2, LOW);  
  delay(35); 
  digitalWrite(W2, HIGH);  
  delay(35);  
  digitalWrite(W2, LOW);  
  delay(35); 
  digitalWrite(R2, HIGH);  
  delay(35);  

//////////
//////////  

  digitalWrite(R, LOW);  
  digitalWrite(Y, LOW);  
  digitalWrite(B, LOW);  
  digitalWrite(W, LOW);  
  digitalWrite(B2, LOW);  
  digitalWrite(Y2, LOW);  
  digitalWrite(R2, LOW);  
  digitalWrite(W2, LOW);  


//1
  digitalWrite(R, HIGH);  
  delay(15);  
  digitalWrite(R, LOW);  
  delay(15); 
  digitalWrite(Y, HIGH);  
  delay(15);  
  digitalWrite(Y, LOW);  
  delay(15); 
  digitalWrite(B, HIGH);  
  delay(15);  
  digitalWrite(B, LOW);  
  delay(15); 
  digitalWrite(W, HIGH);  
  delay(15);  
  digitalWrite(W, LOW);  
  delay(15); 
  digitalWrite(B2, HIGH);  
  delay(15);  
  digitalWrite(B2, LOW);  
  delay(15); 
  digitalWrite(Y2, HIGH);  
  delay(15);  
  digitalWrite(Y2, LOW);  
  delay(15); 
  digitalWrite(R2, HIGH);  
  delay(15);  
  digitalWrite(R2, LOW);  
  delay(15); 
  digitalWrite(W2, HIGH);  
  delay(100); 


//2
  digitalWrite(R, HIGH);  
  delay(15);  
  digitalWrite(R, LOW);  
  delay(15); 
  digitalWrite(Y, HIGH);  
  delay(15);  
  digitalWrite(Y, LOW);  
  delay(15); 
  digitalWrite(B, HIGH);  
  delay(15);  
  digitalWrite(B, LOW);  
  delay(15); 
  digitalWrite(W, HIGH);  
  delay(15);  
  digitalWrite(W, LOW);  
  delay(15); 
  digitalWrite(B2, HIGH);  
  delay(15);  
  digitalWrite(B2, LOW);  
  delay(15); 
  digitalWrite(Y2, HIGH);  
  delay(15);  
  digitalWrite(Y2, LOW);  
  delay(15); 
  digitalWrite(R2, HIGH);  
  delay(100); 

  //3
  digitalWrite(R, HIGH);  
  delay(15);  
  digitalWrite(R, LOW);  
  delay(15); 
  digitalWrite(Y, HIGH);  
  delay(15);  
  digitalWrite(Y, LOW);  
  delay(15); 
  digitalWrite(B, HIGH);  
  delay(15);  
  digitalWrite(B, LOW);  
  delay(15); 
  digitalWrite(W, HIGH);  
  delay(15);  
  digitalWrite(W, LOW);  
  delay(15); 
  digitalWrite(B2, HIGH);  
  delay(15);  
  digitalWrite(B2, LOW);  
  delay(15); 
  digitalWrite(Y2, HIGH);  
  delay(100); 

    //4
  digitalWrite(R, HIGH);  
  delay(15);  
  digitalWrite(R, LOW);  
  delay(15); 
  digitalWrite(Y, HIGH);  
  delay(15);  
  digitalWrite(Y, LOW);  
  delay(15); 
  digitalWrite(B, HIGH);  
  delay(15);  
  digitalWrite(B, LOW);  
  delay(15); 
  digitalWrite(W, HIGH);  
  delay(15);  
  digitalWrite(W, LOW);  
  delay(15); 
  digitalWrite(B2, HIGH);  
  delay(100); 

    //5
  digitalWrite(R, HIGH);  
  delay(15);  
  digitalWrite(R, LOW);  
  delay(15); 
  digitalWrite(Y, HIGH);  
  delay(15);  
  digitalWrite(Y, LOW);  
  delay(15); 
  digitalWrite(B, HIGH);  
  delay(15);  
  digitalWrite(B, LOW);  
  delay(15); 
  digitalWrite(W, HIGH);  
  delay(100); 

  //6
  digitalWrite(R, HIGH);  
  delay(15);  
  digitalWrite(R, LOW);  
  delay(15); 
  digitalWrite(Y, HIGH);  
  delay(15);  
  digitalWrite(Y, LOW);  
  delay(15); 
  digitalWrite(B, HIGH);   
  delay(100); 

    //7
  digitalWrite(R, HIGH);  
  delay(15);  
  digitalWrite(R, LOW);  
  delay(15); 
  digitalWrite(Y, HIGH);    
  delay(100); 

      //8
  digitalWrite(R, HIGH);    
  delay(100); 
  
}
  

///////////////////////////

void setColor(int red,int green,int blue)
{
  analogWrite(LEDr,red);
  analogWrite(LEDg,green);
  analogWrite(LEDb,blue); 
}

////FELIZ///NAVIDAD////////
    

Christmas_CyberTree.ino

Arduino
/*
  Parpadeo de 8 LEDs
  Secuencias de parpadeos de 8 LEDs + LED RGB
 */


//Declaracion de los pines como constantes:
const int LEDr=9; //Color rojo pin 9
const int LEDb=10; //Color azul pin 10
const int LEDg=11; //Color verde pin 11
//Declaracin de las variables necesarias:

int rojo=0;
int verde=0;
int azul=0;

int rled = 2;         // Pin digital al que conectamos el LED rojo
int yled = 3;         // Pin digital al que conectamos el LED amarillo
int bled = 4;         // Pin digital al que conectamos el LED azul
int wled = 5;         // Pin digital al que conectamos el LED blanco
int b2led = 6;        // Pin digital al que conectamos el LED azul 2
int y2led = 7;        // Pin digital al que conectamos el LED amarillo 2
int r2led = 8;        // Pin digital al que conectamos el LED rojo 2
int wl = 12;          // Pin digital al que conectamos el LED blanco 2

void setup() {               
  pinMode(rled, OUTPUT);    // Configracin del pin 2 como salida
  pinMode(yled, OUTPUT);    // Configracin del pin 3 como salida
  pinMode(bled, OUTPUT);    // Configracin del pin 4 como salida
  pinMode(wled, OUTPUT);    // Configracin del pin 5 como salida
  pinMode(b2led, OUTPUT);   // Configracin del pin 6 como salida
  pinMode(y2led, OUTPUT);   // Configracin del pin 7 como salida
  pinMode(r2led, OUTPUT);   // Configracin del pin 8 como salida
  pinMode(wl, OUTPUT);   // Configracin del pin 12 como salida

  setColor(0,255,255);
  delay(50);
  setColor(255,0,255);
  delay(50);
  setColor(255,255,0);
  delay(50);

  //Comprobacion todos los colores
  setColor(255,255,255);
  delay(50);
  setColor(0,0,0);
  delay(50);
  setColor(255,255,255);
  delay(50);
  //Dejamos el color rojo para empezar el loop
  setColor(255,0,255);
  delay(10);
  }

void loop() 

{ 
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
    digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
    digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  
  //Se mantiene el rojo al maximo mientras sube el verde
  for (int verde=255;verde>=0;verde--){
    setColor(0,verde,255);
    delay(1);
    } 
  //Se mantiene el verde al maximo mientras baja el rojo
  for (int rojo=0;rojo<=255;rojo++){
    setColor(rojo,0,255);
    delay(1);
    }
  //Se mantiene el verde al maximo mientras sube el azul
  for (int azul=255;azul>=0;azul--){
    setColor(255,0,azul);
    delay(1);
    }
  //Se mantiene el azul al maximo mientras baja el verde
  for (int verde=0;verde<=255;verde++){
    setColor(255,verde,0);
    delay(1);
    }
  
  //Se mantiene el rojo al maximo mientras baja el azul
  for (int azul=0;azul<=255;azul++){
    setColor(0,255,azul);
    if(azul==255){
      delay(1);
      }
    else{ 
      delay(1);
      }
    }
  
/////////////

 digitalWrite(rled, HIGH);  
  delay(20);                
  digitalWrite(yled, HIGH); 
  delay(20);                  
  digitalWrite(bled, HIGH);  
  delay(20);                  
  digitalWrite(wled, HIGH);  
  delay(20);                  
  digitalWrite(b2led, HIGH); 
  delay(20);                   
  digitalWrite(y2led, HIGH);  
  delay(20);                 
  digitalWrite(r2led, HIGH);  
  delay(20);                 

  digitalWrite(rled, LOW);  
  delay(20);                  
  digitalWrite(yled, LOW);  
  delay(20);                
  digitalWrite(bled, LOW); 
  delay(20);               
  digitalWrite(wled, LOW);  
  delay(20);                 
  digitalWrite(b2led, LOW);  
  delay(20);                  
  digitalWrite(y2led, LOW);  
  delay(20);                 
  digitalWrite(r2led, LOW);  
  delay(20);                  

////destello blanco////

  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  
/////////////

//Se mantiene el rojo al maximo mientras sube el verde
  for (int verde=255;verde>=0;verde--){
    setColor(0,verde,255);
    delay(1);
    } 

    //////

 digitalWrite(rled, HIGH); 
  delay(10);                  
  digitalWrite(rled, LOW); 
  delay(10);                  
  
  digitalWrite(yled, HIGH);  
  delay(10);                 
  digitalWrite(yled, LOW);  
  delay(10);                 
  
  digitalWrite(bled, HIGH);  
  delay(10);                  
  digitalWrite(bled, LOW);  
  delay(10);                  
  
  digitalWrite(wled, HIGH); 
  delay(10);                  
  digitalWrite(wled, LOW); 
  delay(10);                  
  
  digitalWrite(b2led, HIGH);  
  delay(10);                  
  digitalWrite(b2led, LOW);  
  delay(10);                  
  
  digitalWrite(y2led, HIGH);  
  delay(10);                  
  digitalWrite(y2led, LOW);  
  delay(10);                  
  
  digitalWrite(r2led, HIGH);  
  delay(10);                  
  digitalWrite(r2led, LOW); 
  delay(10);  

  ///destello blanco///
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  
  /////

  digitalWrite(rled, HIGH); 
  delay(10);                  
  digitalWrite(rled, LOW); 
  delay(10);                  
  
  digitalWrite(yled, HIGH);  
  delay(10);                 
  digitalWrite(yled, LOW);  
  delay(10);                 
  
  digitalWrite(bled, HIGH);  
  delay(10);                  
  digitalWrite(bled, LOW);  
  delay(10);                  
  
  digitalWrite(wled, HIGH); 
  delay(10);                  
  digitalWrite(wled, LOW); 
  delay(10);                  
  
  digitalWrite(b2led, HIGH);  
  delay(10);                  
  digitalWrite(b2led, LOW);  
  delay(10);                  
  
  digitalWrite(y2led, HIGH);  
  delay(10);                  
  digitalWrite(y2led, LOW);  
  delay(10);                  
  
  digitalWrite(r2led, HIGH);  
  delay(10);                  
  digitalWrite(r2led, LOW); 
  delay(10);  
  
  ///destello blanco///
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100);
  
  /////

  //Se mantiene el verde al maximo mientras baja el rojo
  for (int rojo=0;rojo<=255;rojo++){
    setColor(rojo,0,255);
    delay(1);
    }

      //Se mantiene el verde al maximo mientras sube el azul
  for (int azul=255;azul>=0;azul--){
    setColor(255,0,azul);
    delay(1);
    
    }

      //Se mantiene el azul al maximo mientras baja el verde
  for (int verde=0;verde<=255;verde++){
    setColor(255,verde,0);
    delay(1);
    }
  
  //Se mantiene el rojo al maximo mientras baja el azul
  for (int azul=0;azul<=255;azul++){
    setColor(0,255,azul);
    if(azul==255){
      delay(1);
      }
    else{ 
      delay(1);
      }
    }

/////////////

  digitalWrite(rled, HIGH);  
  delay(30);                
  digitalWrite(yled, HIGH); 
  delay(30);                  
  digitalWrite(bled, HIGH);  
  delay(30);                  
  digitalWrite(wled, HIGH);  
  delay(30);                  
  digitalWrite(b2led, HIGH); 
  delay(30);                   
  digitalWrite(y2led, HIGH);  
  delay(30);                 
  digitalWrite(r2led, HIGH);  
  delay(30);    

  digitalWrite(wl, HIGH);  
  delay(30); 
//
  digitalWrite(rled, LOW);  
  delay(30);                  
  digitalWrite(yled, LOW);  
  delay(30);                
  digitalWrite(bled, LOW); 
  delay(30);               
  digitalWrite(wled, LOW);  
  delay(30);                 
  digitalWrite(b2led, LOW);  
  delay(30);                  
  digitalWrite(y2led, LOW);  
  delay(30);                 
  digitalWrite(r2led, LOW);  
  delay(30);  

  digitalWrite(wl, LOW);  
  delay(30);

////

  //Se mantiene el rojo al maximo mientras sube el verde
  for (int verde=255;verde>=0;verde--){
    setColor(0,verde,255);
    delay(1);
    } 
  
  //Se mantiene el rojo al maximo mientras sube el verde
  for (int verde=30;verde>=0;verde--){
    setColor(0,verde,30);
    delay(1);
    } 

    //////
  
    digitalWrite(rled, HIGH); 
  delay(30);                  
  digitalWrite(rled, LOW); 
  delay(30);                  
  
  digitalWrite(yled, HIGH);  
  delay(30);                 
  digitalWrite(yled, LOW);  
  delay(30);                 
  
  digitalWrite(bled, HIGH);  
  delay(30);                  
  digitalWrite(bled, LOW);  
  delay(30);                  
  
  digitalWrite(wled, HIGH); 
  delay(30);                  
  digitalWrite(wled, LOW); 
  delay(30);                  
  
  digitalWrite(b2led, HIGH);  
  delay(30);                  
  digitalWrite(b2led, LOW);  
  delay(30);                  
  
  digitalWrite(y2led, HIGH);  
  delay(30);                  
  digitalWrite(y2led, LOW);  
  delay(30);                  
  
  digitalWrite(r2led, HIGH);  
  delay(30);                  
  digitalWrite(r2led, LOW); 
  delay(30);                  

  ///destello blanco///
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  /////

    //Se mantiene el azul al maximo mientras baja el verde
  for (int verde=0;verde<=255;verde++){
    setColor(255,verde,0);
    delay(1);
    }
  
  //Se mantiene el rojo al maximo mientras baja el azul
  for (int azul=0;azul<=255;azul++){
    setColor(0,255,azul);
    if(azul==255){
      delay(1);
      }
    else{ 
      delay(1);
      }
    }

    ////
 
  digitalWrite(rled, HIGH); 
  delay(60);                  
  digitalWrite(rled, LOW); 
  delay(30);                  
  
  digitalWrite(yled, HIGH);  
  delay(60);                 
  digitalWrite(yled, LOW);  
  delay(30);                 
  
  digitalWrite(bled, HIGH);  
  delay(60);                  
  digitalWrite(bled, LOW);  
  delay(30);                  
  
  digitalWrite(wled, HIGH); 
  delay(60);                  
  digitalWrite(wled, LOW); 
  delay(30);                  
  
  digitalWrite(b2led, HIGH);  
  delay(60);                  
  digitalWrite(b2led, LOW);  
  delay(30);                  
  
  digitalWrite(y2led, HIGH);  
  delay(60);                  
  digitalWrite(y2led, LOW);  
  delay(30);                  
  
  digitalWrite(r2led, HIGH);  
  delay(60);                  
  digitalWrite(r2led, LOW); 
  delay(30); 

    ///destello blanco///
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  /////

 //Se mantiene el azul al maximo mientras baja el verde
  for (int verde=0;verde<=50;verde++){
    setColor(50,verde,0);
    delay(1);
    }
  
  //Se mantiene el rojo al maximo mientras baja el azul
  for (int azul=0;azul<=55;azul++){
    setColor(0,55,azul);
    if(azul==55){
      delay(1);
      }
    else{ 
      delay(1);
      }
    }

/////////////

  digitalWrite(rled, HIGH); 
  delay(50);                  
  digitalWrite(rled, LOW); 
  delay(50);                  
  
  digitalWrite(yled, HIGH);  
  delay(50);                 
  digitalWrite(yled, LOW);  
  delay(50);                 
  
  digitalWrite(bled, HIGH);  
  delay(50);                  
  digitalWrite(bled, LOW);  
  delay(50);                  
  
  digitalWrite(wled, HIGH); 
  delay(50);                  
  digitalWrite(wled, LOW); 
  delay(50);                  
  
  digitalWrite(b2led, HIGH);  
  delay(50);                  
  digitalWrite(b2led, LOW);  
  delay(50);                  
  
  digitalWrite(y2led, HIGH);  
  delay(50);                  
  digitalWrite(y2led, LOW);  
  delay(50);                  
  
  digitalWrite(r2led, HIGH);  
  delay(50);                  
  digitalWrite(r2led, LOW); 
  delay(50);               

//////////

    ///destello blanco///
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
  digitalWrite(wl, HIGH);  
  delay(5);  
  digitalWrite(wl, LOW);  
  delay(100); 
   
/////////////

  digitalWrite(rled, HIGH);  
  delay(100);                 
  
  digitalWrite(r2led, HIGH); 
  delay(100); 
 
  digitalWrite(yled, HIGH); 
  delay(100);                 

  digitalWrite(y2led, HIGH);  
  delay(100);                 
  
  digitalWrite(bled, HIGH);  
  delay(100);                 
 
  digitalWrite(b2led, HIGH); 
  delay(100);                   
  
  digitalWrite(wled, HIGH);  
  delay(100);                  
 

  digitalWrite(rled, LOW);  
  delay(50);                 

  digitalWrite(r2led, LOW);  
  delay(50);    

  digitalWrite(yled, LOW);  
  delay(70);                  

  digitalWrite(y2led, LOW);  
  delay(70);  

  digitalWrite(bled, LOW);  
  delay(100);                
  
  digitalWrite(b2led, LOW); 
  delay(150);                

  digitalWrite(wled, LOW);  
  delay(200);

///////////////////////////

  digitalWrite(rled, HIGH);  
  digitalWrite(r2led, HIGH); 
  delay(200); 
 
  digitalWrite(yled, HIGH); 
  digitalWrite(y2led, HIGH);  
  delay(200);                 
  
  digitalWrite(bled, HIGH);  
  digitalWrite(b2led, HIGH); 
  delay(200);                   
  
  digitalWrite(wled, HIGH);  
  delay(200);                  
 
  digitalWrite(rled, LOW);  
  digitalWrite(r2led, LOW);  
  delay(300);    

  digitalWrite(yled, LOW);  
  digitalWrite(y2led, LOW);  
  delay(300);  

  digitalWrite(bled, LOW);  
  digitalWrite(b2led, LOW); 
  delay(300);                

  digitalWrite(wled, LOW);  
  delay(300);   

///////

//Se mantiene el azul al maximo mientras baja el verde
  for (int verde=0;verde<=0;verde++){
    setColor(0,verde,0);
    delay(1);
    }
  
  //Se mantiene el rojo al maximo mientras baja el azul
  for (int azul=0;azul<=5;azul++){
    setColor(0,10,azul);
    if(azul==0){
      delay(1);
      }
    else{ 
      delay(1);
      }
    }

    //////

  digitalWrite(wl, HIGH);  
  delay(50);  
  digitalWrite(wl, LOW);  
  delay(50); 
  digitalWrite(wl, HIGH);  
  delay(50);  
  digitalWrite(wl, LOW);  
  delay(50); 
  digitalWrite(wl, HIGH);  
  delay(50);  
  digitalWrite(wl, LOW);  
  delay(50); 

  digitalWrite(wled, HIGH);  
  delay(50);  
  digitalWrite(wled, LOW);  
  delay(50);  
  digitalWrite(wled, HIGH);  
  delay(50);  
  digitalWrite(wled, LOW);  
  delay(50);  
  digitalWrite(wled, HIGH);  
  delay(50);  
  digitalWrite(wled, LOW);  
  delay(50);  

  digitalWrite(wl, HIGH);  
  delay(50);  
  digitalWrite(wl, LOW);  
  delay(50); 
  digitalWrite(wl, HIGH);  
  delay(50);  
  digitalWrite(wl, LOW);  
  delay(50); 
  digitalWrite(wl, HIGH);  
  delay(50);  
  digitalWrite(wl, LOW);  
  delay(50); 

  digitalWrite(wled, HIGH);  
  delay(50);  
  digitalWrite(wled, LOW);  
  delay(50);  
  digitalWrite(wled, HIGH);  
  delay(50);  
  digitalWrite(wled, LOW);  
  delay(50);  
  digitalWrite(wled, HIGH);  
  delay(50);  
  digitalWrite(wled, LOW);  
  delay(50);  

//

  digitalWrite(wl, HIGH);  
  delay(50);  
  digitalWrite(wl, LOW);  
  delay(50); 
  digitalWrite(wled, HIGH);  
  delay(50);  
  digitalWrite(wled, LOW);  
  delay(50); 

  digitalWrite(wl, HIGH);  
  delay(50);  
  digitalWrite(wl, LOW);  
  delay(50); 
  digitalWrite(wled, HIGH);  
  delay(50);  
  digitalWrite(wled, LOW);  
  delay(50); 
  
  digitalWrite(wl, HIGH);  
  delay(50);  
  digitalWrite(wl, LOW);  
  delay(50); 
  digitalWrite(wled, HIGH);  
  delay(50);  
  digitalWrite(wled, LOW);  
  delay(50); 

  digitalWrite(wl, HIGH);  
  delay(50);  
  digitalWrite(wl, LOW);  
  delay(50); 
  digitalWrite(wled, HIGH);  
  delay(50);  
  digitalWrite(wled, LOW);  
  delay(50); 

  digitalWrite(wl, HIGH);  
  delay(50);  
  digitalWrite(wl, LOW);  
  delay(50); 
  digitalWrite(wled, HIGH);  
  delay(50);  
  digitalWrite(wled, LOW);  
  delay(50); 
  
  digitalWrite(wl, HIGH);  
  delay(50);  
  digitalWrite(wl, LOW);  
  delay(50); 
  digitalWrite(wled, HIGH);  
  delay(50);  
  digitalWrite(wled, LOW);  
  delay(50); 

///////////////////////////
                  
 //Se mantiene el rojo al maximo mientras baja el azul
  for (int azul=0;azul<=255;azul++){
    setColor(0,255,azul);
    if(azul==255){
      delay(1);
      }
      }

///////////////////////////

  ///raya/////////////////
 
  digitalWrite(wled, HIGH);   
  digitalWrite(yled, HIGH);  
  digitalWrite(y2led, HIGH);
  digitalWrite(bled, HIGH);   
  digitalWrite(b2led, HIGH);  
  digitalWrite(rled, HIGH);
  digitalWrite(r2led, HIGH);   
  delay(500); 
  
  digitalWrite(wled, LOW);   
  digitalWrite(yled, LOW);  
  digitalWrite(y2led, LOW);
  digitalWrite(bled, LOW);   
  digitalWrite(b2led, LOW);  
  digitalWrite(rled, LOW);
  digitalWrite(r2led, LOW);   
  delay(200);         

  digitalWrite(wled, HIGH);   
  digitalWrite(yled, HIGH);  
  digitalWrite(y2led, HIGH);
  digitalWrite(bled, HIGH);   
  digitalWrite(b2led, HIGH);  
  digitalWrite(rled, HIGH);
  digitalWrite(r2led, HIGH);   
  delay(500); 
  
  digitalWrite(wled, LOW);   
  digitalWrite(yled, LOW);  
  digitalWrite(y2led, LOW);
  digitalWrite(bled, LOW);   
  digitalWrite(b2led, LOW);  
  digitalWrite(rled, LOW);
  digitalWrite(r2led, LOW);   
  delay(200);   

////punto//////////////////

  digitalWrite(wled, HIGH);   
  digitalWrite(yled, HIGH);  
  digitalWrite(y2led, HIGH);
  digitalWrite(bled, HIGH);   
  digitalWrite(b2led, HIGH);  
  digitalWrite(rled, HIGH);
  digitalWrite(r2led, HIGH);   
  delay(70); 
  
  digitalWrite(wled, LOW);   
  digitalWrite(yled, LOW);  
  digitalWrite(y2led, LOW);
  digitalWrite(bled, LOW);   
  digitalWrite(b2led, LOW);  
  digitalWrite(rled, LOW);
  digitalWrite(r2led, LOW);   
  delay(200);   

  digitalWrite(wled, HIGH);   
  digitalWrite(yled, HIGH);  
  digitalWrite(y2led, HIGH);
  digitalWrite(bled, HIGH);   
  digitalWrite(b2led, HIGH);  
  digitalWrite(rled, HIGH);
  digitalWrite(r2led, HIGH);   
  delay(70); 
  
  digitalWrite(wled, LOW);   
  digitalWrite(yled, LOW);  
  digitalWrite(y2led, LOW);
  digitalWrite(bled, LOW);   
  digitalWrite(b2led, LOW);  
  digitalWrite(rled, LOW);
  digitalWrite(r2led, LOW);   
  delay(200); 

////////////////////////////

  digitalWrite(rled, HIGH); 
  delay(70);                 
  digitalWrite(yled, HIGH);  
  delay(65);                 
  digitalWrite(bled, HIGH); 
  delay(60);                 
  digitalWrite(wled, HIGH);  
  delay(55);                 
  digitalWrite(y2led, HIGH); 
  delay(50);                  
  digitalWrite(b2led, HIGH);  
  delay(45);                 
  digitalWrite(r2led, HIGH);  
  delay(40);     

  digitalWrite(wl, HIGH);  
  delay(100);    

  digitalWrite(rled, LOW);  
  delay(40);                  
  digitalWrite(yled, LOW);  
  delay(45);                
  digitalWrite(bled, LOW);  
  delay(50);                 
  digitalWrite(wled, LOW);  
  delay(55);                 
  digitalWrite(b2led, LOW);  
  delay(60);                
  digitalWrite(y2led, LOW); 
  delay(65);                 
  digitalWrite(r2led, LOW);  
  delay(70);

  digitalWrite(wl, LOW);  
  delay(100);  
  
 ///////////////////////////

 digitalWrite(rled, HIGH); 
  delay(70);                 
  digitalWrite(yled, HIGH);  
  delay(65);                 
  digitalWrite(bled, HIGH); 
  delay(60);                 
  digitalWrite(wled, HIGH);  
  delay(55);                 
  digitalWrite(y2led, HIGH); 
  delay(50);                  
  digitalWrite(b2led, HIGH);  
  delay(45);                 
  digitalWrite(r2led, HIGH);  
  delay(40);     

  digitalWrite(wl, HIGH);  
  delay(100);    

  digitalWrite(rled, LOW);  
  delay(40);                  
  digitalWrite(yled, LOW);  
  delay(45);                
  digitalWrite(bled, LOW);  
  delay(50);                 
  digitalWrite(wled, LOW);  
  delay(55);                 
  digitalWrite(b2led, LOW);  
  delay(60);                
  digitalWrite(y2led, LOW); 
  delay(65);                 
  digitalWrite(r2led, LOW);  
  delay(70);

  digitalWrite(wl, LOW);  
  delay(100);  
  
///////////////////////////

  digitalWrite(rled, HIGH); 
  delay(30);                 
  digitalWrite(yled, HIGH);  
  delay(25);                 
  digitalWrite(bled, HIGH); 
  delay(20);                 
  digitalWrite(wled, HIGH);  
  delay(15);                 
  digitalWrite(y2led, HIGH); 
  delay(10);                  
  digitalWrite(b2led, HIGH);  
  delay(5);                 
  digitalWrite(r2led, HIGH);  
  delay(1);                  

  digitalWrite(rled, LOW);  
  delay(1);                  
  digitalWrite(yled, LOW);  
  delay(5);                
  digitalWrite(bled, LOW);  
  delay(10);                 
  digitalWrite(wled, LOW);  
  delay(15);                 
  digitalWrite(b2led, LOW);  
  delay(20);                
  digitalWrite(y2led, LOW); 
  delay(25);                 
  digitalWrite(r2led, LOW);  
  delay(30);                 
}
///////////////////////////

void setColor(int red,int green,int blue)
{
  analogWrite(LEDr,red);
  analogWrite(LEDg,green);
  analogWrite(LEDb,blue); 
}

////FELIZ///NAVIDAD////////
    

Credits

Guiye Perez Bongiovanni

Guiye Perez Bongiovanni

12 projects • 22 followers
Artist / Maker

Comments