uint8_t segmPin[] = {12, 13, 7, 8, 9, 11, 10, 6};
// Сегменти: A, B, C, D, E, F, G, DP
uint8_t code[] = {63, 6, 91, 79, 102, 109, 125, 39, 127, 111, 0};
void setup() {
// put your setup code here, to run once:
for (uint8_t segm = 0; segm < 8; segm++){
pinMode(segmPin[segm], OUTPUT);
}
}
void loop() {
// put your main code here, to run repeatedly:
display(4);
delay(1000);
display(5);
delay(1000);
display(10);
delay(1000);
}
void display(uint8_t symbol){
for (uint8_t segm = 0; segm < 7; segm++){
bool segmState = bitRead(code[symbol], segm);
digitalWrite(segmPin[segm], segmState);
}
}