void setup() 
{
  DDRD = 0b11111111;
  PORTD = 0b00000001;
}

void loop() 
{
  PORTD = PORTD<<1;
  if(PORTD == 0b00100000)
  {
    delay(100);
    PORTD = 0b00000001;
  }
  delay(100);
}