// Improved version of previous 7 segment display 
// using direct register access with arrays functions.
// Created by kidkara.

int ledarrayD[10]{B11111100,B00011000,B01101100,B00111100,B10011000,
                  B10110100,B11110100,B00011100,B11111100,B10111100};
int ledarrayB[10]{B00000000,B00000000,B00000001,B00000001,B00000001,
                  B00000001,B00000001,B00000000,B00000001,B00000001};

void setup() {
  DDRD=B11111100;
  DDRB=B00000001;
}   

void loop() {
for(int i=0; i<10; i++)
{
PORTD = ledarrayD[i];
PORTB = ledarrayB[i];
delay(1000);
}

}