/*--- Binary Counting with 8 bits ---*/
void Dlay(){
delay(100);
}
void setup()
{
DDRD = DDRD | B11111100; //Data Direction Register for Port D
DDRB = DDRB | B00000011; //Data Direction Register for Port B
}
void loop()
{
PORTD = B00000100; //zero and one are used for serial com.
Dlay();
PORTD = B00001100;
Dlay();
PORTD = B00011100;
Dlay();
PORTD = B00111100;
Dlay();
PORTD = B01111100;
Dlay();
PORTD = B11111100;
Dlay();
PORTD = B11111100;
PORTB = B00000001;
Dlay();
PORTD = B11111100;
PORTB = B00000011;
Dlay();
PORTD = B11111100;
PORTB = B00000001;
Dlay();
PORTD = B11111100;
PORTB = B00000000;
Dlay();
PORTD = B01111100;
Dlay();
PORTD = B00111100;
Dlay();
PORTD = B00011100;
Dlay();
PORTD = B00001100;
Dlay();
PORTD = B00000100;
Dlay();
PORTD = B00000000;
Dlay();
}