Arduino Code 2



 int LED1 = 2;
int LED2 = 3;
int LED3 = 4;
int LED4 = 5;
int LED5 = 6;
int LED6 = 7;
int LED7 = 8;
int LED8 = 9;
int LED9 = 10;
int LED10 = 11;
int LED11 = 12;
int LED12 = 13;
int t=20;
int y=100;



void setup() {
   pinMode(LED1, OUTPUT);
   pinMode(LED2, OUTPUT);
  pinMode(LED3, OUTPUT); 
   pinMode(LED4, OUTPUT);
   pinMode(LED5, OUTPUT);
   pinMode(LED6, OUTPUT);
   pinMode(LED7, OUTPUT);
   pinMode(LED8, OUTPUT);
   pinMode(LED9, OUTPUT);
   pinMode(LED10, OUTPUT);
   pinMode(LED11, OUTPUT);
   pinMode(LED12, OUTPUT);
    
}


void loop() {
                    
  digitalWrite(LED12, HIGH);    
  delay(t);                 
  digitalWrite(LED11, HIGH);    
  delay(t);                  
  digitalWrite(LED10, HIGH); 
  delay(t);                 
  digitalWrite(LED9, HIGH);  
  delay(t);                  
  digitalWrite(LED8, HIGH);    
  delay(t);                 
  digitalWrite(LED7, HIGH);    
  delay(t);                 
  digitalWrite(LED6, HIGH);  
  delay(t);               
  digitalWrite(LED5, HIGH); 
  delay(t);  
  digitalWrite(LED4, HIGH);    
  delay(t);
  digitalWrite(LED3, HIGH);    
  delay(t);
  digitalWrite(LED2, HIGH);    
  delay(t);
  digitalWrite(LED1, HIGH);    
  delay(t);
   
                    
  digitalWrite(LED12, LOW);    
  delay(t);                
  digitalWrite(LED11, LOW);    
  delay(t);                  
  digitalWrite(LED10, LOW);   
  delay(t);               
  digitalWrite(LED9, LOW);     
  delay(t);               
  digitalWrite(LED8, LOW);  
 delay(t);                 
  digitalWrite(LED7, LOW);  
  delay(t);                  
  digitalWrite(LED6, LOW);     
  delay(t);                  
  digitalWrite(LED5, LOW);   
  delay(t); 
  digitalWrite(LED4, LOW);    
  delay(t);
  digitalWrite(LED3, LOW);    
  delay(t);
  digitalWrite(LED2, LOW);    
  delay(t);
  digitalWrite(LED1, LOW);    
  delay(t);

  digitalWrite(LED1, HIGH);    
  delay(t);
  digitalWrite(LED2, HIGH);    
  delay(t);
  digitalWrite(LED3, HIGH);    
  delay(t);
  digitalWrite(LED4, HIGH);    
  delay(t); 
  digitalWrite(LED5, HIGH); 
  delay(t);
  digitalWrite(LED6, HIGH);  
  delay(t);
  digitalWrite(LED7, HIGH);  
  delay(t);
  digitalWrite(LED8, HIGH);  
  delay(t);
  digitalWrite(LED9, HIGH);  
  delay(t);
  digitalWrite(LED10, HIGH);  
  delay(t);
  digitalWrite(LED11, HIGH);  
  delay(t);
  digitalWrite(LED12, HIGH);  
  delay(t);

  digitalWrite(LED1, LOW);    
  delay(t);
  digitalWrite(LED2, LOW);    
  delay(t);
  digitalWrite(LED3, LOW);    
  delay(t);
  digitalWrite(LED4, LOW);    
  delay(t);
  digitalWrite(LED5, LOW);    
  delay(t);
  digitalWrite(LED6, LOW);    
  delay(t);
  digitalWrite(LED7, LOW);    
  delay(t);
  digitalWrite(LED8, LOW);    
  delay(t);
  digitalWrite(LED9, LOW);    
  delay(t);
  digitalWrite(LED10, LOW);    
  delay(t);
  digitalWrite(LED11, LOW);    
  delay(t);
  digitalWrite(LED12, LOW);    
  delay(t);

  digitalWrite(LED12, HIGH);    
  delay(t);                 
  digitalWrite(LED11, HIGH);    
  delay(t);                  
  digitalWrite(LED10, HIGH); 
  delay(t);                 
  digitalWrite(LED9, HIGH);  
  delay(t);                  
  digitalWrite(LED8, HIGH);    
  delay(t);                 
  digitalWrite(LED7, HIGH);    
  delay(t);                 
  digitalWrite(LED6, HIGH);  
  delay(t);               
  digitalWrite(LED5, HIGH); 
  delay(t);  
  digitalWrite(LED4, HIGH);    
  delay(t);
  digitalWrite(LED3, HIGH);    
  delay(t);
  digitalWrite(LED2, HIGH);    
  delay(t);
  digitalWrite(LED1, HIGH);    
  delay(t);
   
                    
  digitalWrite(LED12, LOW);    
  delay(t);                
  digitalWrite(LED11, LOW);    
  delay(t);                  
  digitalWrite(LED10, LOW);   
  delay(t);               
  digitalWrite(LED9, LOW);     
  delay(t);               
  digitalWrite(LED8, LOW);  
 delay(t);                 
  digitalWrite(LED7, LOW);  
  delay(t);                  
  digitalWrite(LED6, LOW);     
  delay(t);                  
  digitalWrite(LED5, LOW);   
  delay(t); 
  digitalWrite(LED4, LOW);    
  delay(t);
  digitalWrite(LED3, LOW);    
  delay(t);
  digitalWrite(LED2, LOW);    
  delay(t);
  digitalWrite(LED1, LOW);    
  delay(t);

   digitalWrite(LED1, HIGH);    
  delay(t); 
  digitalWrite(LED2, HIGH);    
  delay(t); 
  digitalWrite(LED3, HIGH);    
  delay(t); 
  digitalWrite(LED4, HIGH);    
  delay(t); 
  digitalWrite(LED5, HIGH); 
  delay(t);
  digitalWrite(LED6, HIGH);  
  delay(t);
  digitalWrite(LED7, HIGH);  
  delay(t);
  digitalWrite(LED8, HIGH);  
  delay(t);
  digitalWrite(LED9, HIGH);  
  delay(t);
  digitalWrite(LED10, HIGH);  
  delay(t);
  digitalWrite(LED11, HIGH);  
  delay(t);
  digitalWrite(LED12, HIGH);  
  delay(t);


  digitalWrite(LED1, LOW);    
  delay(t);
  digitalWrite(LED2, LOW);    
  delay(t);
  digitalWrite(LED3, LOW);    
  delay(t);
  digitalWrite(LED4, LOW);    
  delay(t);
  digitalWrite(LED5, LOW);    
  delay(t);
  digitalWrite(LED6, LOW);    
  delay(t);
  digitalWrite(LED7, LOW);    
  delay(t);
  digitalWrite(LED8, LOW);    
  delay(t);
  digitalWrite(LED9, LOW);    
  delay(t);
  digitalWrite(LED10, LOW);    
  delay(t);
  digitalWrite(LED11, LOW);    
  delay(t);
  digitalWrite(LED12, LOW);    
  delay(t);

  digitalWrite(LED12, HIGH);    
  delay(t);                 
  digitalWrite(LED11, HIGH);    
  delay(t);                  
  digitalWrite(LED10, HIGH); 
  delay(t);                 
  digitalWrite(LED9, HIGH);  
  delay(t);                  
  digitalWrite(LED8, HIGH);    
  delay(t);                 
  digitalWrite(LED7, HIGH);    
  delay(t);                 
  digitalWrite(LED6, HIGH);  
  delay(t);               
  digitalWrite(LED5, HIGH); 
  delay(t);  
  digitalWrite(LED4, HIGH);    
  delay(t);
  digitalWrite(LED3, HIGH);    
  delay(t);
  digitalWrite(LED2, HIGH);    
  delay(t);
  digitalWrite(LED1, HIGH);    
  delay(t);
   
                    
  digitalWrite(LED12, LOW);    
  delay(t);                
  digitalWrite(LED11, LOW);    
  delay(t);                  
  digitalWrite(LED10, LOW);   
  delay(t);               
  digitalWrite(LED9, LOW);     
  delay(t);               
  digitalWrite(LED8, LOW);  
 delay(t);                 
  digitalWrite(LED7, LOW);  
  delay(t);                  
  digitalWrite(LED6, LOW);     
  delay(t);                  
  digitalWrite(LED5, LOW);   
  delay(t); 
  digitalWrite(LED4, LOW);    
  delay(t);
  digitalWrite(LED3, LOW);    
  delay(t);
  digitalWrite(LED2, LOW);    
  delay(t);
  digitalWrite(LED1, LOW);    
  delay(t);

  digitalWrite(LED1, HIGH);    
  delay(t);
  digitalWrite(LED2, HIGH);    
  delay(t);
  digitalWrite(LED3, HIGH);    
  delay(t);
  digitalWrite(LED4, HIGH);    
  delay(t); 
  digitalWrite(LED5, HIGH); 
  delay(t);
  digitalWrite(LED6, HIGH);  
  delay(t);
  digitalWrite(LED7, HIGH);  
  delay(t);
  digitalWrite(LED8, HIGH);  
  delay(t);
  digitalWrite(LED9, HIGH);  
  delay(t);
  digitalWrite(LED10, HIGH);  
  delay(t);
  digitalWrite(LED11, HIGH);  
  delay(t);
  digitalWrite(LED12, HIGH);  
  delay(t);

  digitalWrite(LED1, LOW);    
  delay(t);
  digitalWrite(LED2, LOW);    
  delay(t);
  digitalWrite(LED3, LOW);    
  delay(t);
  digitalWrite(LED4, LOW);    
  delay(t);
  digitalWrite(LED5, LOW);    
  delay(t);
  digitalWrite(LED6, LOW);    
  delay(t);
  digitalWrite(LED7, LOW);    
  delay(t);
  digitalWrite(LED8, LOW);    
  delay(t);
  digitalWrite(LED9, LOW);    
  delay(t);
  digitalWrite(LED10, LOW);    
  delay(t);
  digitalWrite(LED11, LOW);    
  delay(t);
  digitalWrite(LED12, LOW);    
  delay(t);

  digitalWrite(LED1, HIGH); 

  digitalWrite(LED2, HIGH); 

  digitalWrite(LED3, HIGH); 

  digitalWrite(LED4, HIGH);    
    
  digitalWrite(LED5, HIGH); 
   
  digitalWrite(LED6, HIGH);  
   
  digitalWrite(LED7, HIGH);  
   
  digitalWrite(LED8, HIGH);  
   
  digitalWrite(LED9, HIGH);  
   
  digitalWrite(LED10, HIGH);  
   
  digitalWrite(LED11, HIGH);  
   
  digitalWrite(LED12, HIGH);  
  delay(3000);

    digitalWrite(LED12, LOW);
    digitalWrite(LED1, LOW);
    delay(y);
    digitalWrite(LED11, LOW);
    digitalWrite(LED2, LOW);
    delay(y);
    digitalWrite(LED10, LOW);
    digitalWrite(LED3, LOW);
    delay(y);
    digitalWrite(LED9, LOW);
    digitalWrite(LED4, LOW);
    delay(y);
    digitalWrite(LED8, LOW);
    digitalWrite(LED5, LOW);
    delay(y);
    digitalWrite(LED7, LOW);
    digitalWrite(LED6, LOW);
    delay(y);
   
  digitalWrite(LED1, LOW);

  digitalWrite(LED2, LOW);

  digitalWrite(LED3, LOW);
  
  digitalWrite(LED4, LOW);    
   
  digitalWrite(LED5, LOW);    
   
  digitalWrite(LED6, LOW);    
   
  digitalWrite(LED7, LOW);    
   
  digitalWrite(LED8, LOW);    
   
  digitalWrite(LED9, LOW);    
   
  digitalWrite(LED10, LOW);    
   
  digitalWrite(LED11, LOW);    
   
  digitalWrite(LED12, LOW); 
  delay(2000);   
   
}


 

Comments

Popular posts from this blog

Arduino Code Car Parking System

Arduino Code