Code Example

int led0 = 2;
int led1 = 3;
int led2 = 4;
int led3 = 5;

void Dlay(){
  delay(50); 
}

void setup() {                
DDRD = B00111100;
}


void loop() {
  digitalWrite(led0, HIGH);   
  Dlay();              
  digitalWrite(led1, HIGH);   
  Dlay(); 
  digitalWrite(led2, HIGH);   
  Dlay();  
  digitalWrite(led3, HIGH);   
  Dlay();    
  digitalWrite(led3, LOW);    
  Dlay();   
  digitalWrite(led2, LOW);    
  Dlay();  
  digitalWrite(led1, LOW);    
  Dlay();  
  digitalWrite(led0, LOW);    
  Dlay();    
}