#define first 2 // Номер пина с которого начинается подключение индикатора
#define count 8 // Количество пинов
byte numberclear = 0b00000000; // Байт очистки индикатора
byte number[10] = { // Байты цифр
0b00111111,
0b00000110,
0b01011011,
0b01001111,
0b01100110,
0b01101101,
0b01111101,
0b00000111,
0b01111111,
0b01101111,
};
void setup() {
// put your setup code here, to run once:
for(int i = 0; i < count; ++i)
pinMode(i + first, OUTPUT); // пины настроить на выход
}
void loop() {
// put your main code here, to run repeatedly:
for (int i = 0; i < 10; i++) { // Перебираем цифры от 0 до 9
for (int j = 0; j < count; j++) { // Перебираем биты в байте
boolean segment = bitRead(number[i], j);
digitalWrite(j + first, segment);
}
delay(1000);
}
}