// matriz int numero[11][8] = { // 11 linhas, 8 colunas { 1,1,1,1,1,1,0,0 }, //0 { 0,1,1,0,0,0,0,0 }, //1 { 1,1,0,1,1,0,1,0 }, //2 { 1,1,1,1,0,0,1,0 }, //3 { 0,1,1,0,0,1,1,0 }, //4 { 1,0,1,1,0,1,1,0 }, //5 { 0,0,1,1,1,1,1,0 }, //6 { 1,1,1,0,0,0,0,0 }, //7 { 1,1,1,1,1,1,1,0 }, //8 { 1,1,1,0,0,1,1,0 }, //9 { 0,0,0,0,0,0,0,1 }, //ponto decimal }; // Configuração dos pinos digitaisconst int segmentos[8] = { 2,3,4,5,6,7,8,9 };// 2 = segmento a// 3 = segmento b// 4 = segmento c// 5 = segmento d// 6 = segmento e// 7 = segmento f// 8 = segmento g// 9 = ponto deciamal void setup() { // configurando os pinos de cada segmento for (int i = 0; i <= 7; i++) { pinMode(segmentos[i], OUTPUT); }} void loop() { for (int i = 0; i <=10; i++) { mostraNumero(i); delay(500); }} void mostraNumero(int valor) { int pino = 2; //começar contagem no pino 2 for (int i = 0; i < 8; i++) { digitalWrite(pino, numero[valor][i]); pino++; }} 

// matriz

int numero[11][8] = { // 11 linhas, 8 colunas
{ 1,1,1,1,1,1,0,0 }, //0
{ 0,1,1,0,0,0,0,0 }, //1
{ 1,1,0,1,1,0,1,0 }, //2
{ 1,1,1,1,0,0,1,0 }, //3
{ 0,1,1,0,0,1,1,0 }, //4
{ 1,0,1,1,0,1,1,0 }, //5
{ 0,0,1,1,1,1,1,0 }, //6
{ 1,1,1,0,0,0,0,0 }, //7
{ 1,1,1,1,1,1,1,0 }, //8
{ 1,1,1,0,0,1,1,0 }, //9
{ 0,0,0,0,0,0,0,1 }, //ponto decimal
};

// Configuração dos pinos digitais
const int segmentos[8] = { 2,3,4,5,6,7,8,9 };
// 2 = segmento a
// 3 = segmento b
// 4 = segmento c
// 5 = segmento d
// 6 = segmento e
// 7 = segmento f
// 8 = segmento g
// 9 = ponto deciamal

void setup() {
// configurando os pinos de cada segmento
for (int i = 0; i <= 7; i++) {
pinMode(segmentos[i], OUTPUT);
}
}

void loop() {
for (int i = 0; i <=10; i++) {
mostraNumero(i);
delay(500);
}
}

void mostraNumero(int valor) {
int pino = 2; //começar contagem no pino 2
for (int i = 0; i < 8; i++) {
digitalWrite(pino, numero[valor][i]);
pino++;
}
}