int delaytime=300;
// ฟังก์ชัน setup สำหรับการตั้งค่าขา
void setup() {
DDRD = 255;
}
void loop() {
PORTD= B00000000;//
delay(delaytime);
PORTD = B10111111;//0
delay(delaytime);
PORTD = B10001001;//1
delay(delaytime);
PORTD = B11100111;//2
delay(delaytime);
PORTD = B11001111;//3
delay(delaytime);
PORTD = B11011001;//4
delay(delaytime);
PORTD= B11011110;//5
delay(delaytime);
PORTD= B11111110;//6
delay(delaytime);
PORTD = B10001011;//7
delay(delaytime);
PORTD= B11111111;//8
delay(delaytime);
PORTD= B11011111;//9
delay(delaytime);
PORTD = B00000000;//
delay(delaytime);
PORTD = 0xBF;//0
delay(delaytime);
PORTD = 0x89;//1
delay(delaytime);
PORTD = 0xE7;//2
delay(delaytime);
PORTD= 0xCF;//3
delay(delaytime);
PORTD = 0xD9;//4
delay(delaytime);
PORTD= 0xDE;//5
delay(delaytime);
PORTD = 0xFE;//6
delay(delaytime);
PORTD = 0x8B;//7
delay(delaytime);
PORTD= 0xFF;//8
delay(delaytime);
PORTD = 0xDF;//9
delay(delaytime);
}