const byte Seven_seg[7] = {0,1,2,3,4,5,6};
byte Count = 0;
const byte numbers[] = {0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};
void setup() {
for (int i = 0;i < 7;i++){
pinMode(Seven_seg[i], OUTPUT);
}
}
void loop() {
displayDigit(Count);
Count = (Count + 1)%10;
delay(500);
}
void displayDigit(byte value){
if(0 <= value && value < 10){
value = numbers[Count];
for (int i = 0;i < 8;i++){
digitalWrite(Seven_seg[i],(value&1));
value >>= 1;
}
}
}