// This example is using 7 Segment common cathode

unsigned char digit[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};

void setup() {
   
  DDRB |= B00001111;  // Pin D8, D9, D10, D11 as output
  DDRD = 0xFF;        // PORTD (pin D0..D7) all as output
  PORTD = 0X0;        // Pin D0..D7 = LOW
  
  PORTB |= B11111110; // activate pin D8 (digit 1) = LOW (aktif low)
  // PORTD = digit[9];   // show digit 9
  // delay(1000);
}


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

}