// ************************************************************//
// DISPLAY VETOR DECIMAL
// Mostra em um display a sequência numérica de 1 até 9, mostrando também ponto e blank
// com o valor de cada vetor em DECIMAL
// ************************************************************//
const int Pinos[8] = { 2, 3, 4, 5, 6, 7, 8, 9 };
byte Numeros[12] = {6,91,79,102,109,125,7,127,103,63,128,00};
//DISPLAY CATODO COMUM
void setup()
{
for(int i = 0; i < 8; i++)
{
pinMode(Pinos[i], OUTPUT);
}
}
void escreveDisplay(int number)
{
byte numberBit = Numeros[number];
for (int i = 0; i < 8; i++)
{
int bit = bitRead(numberBit, i);
digitalWrite(Pinos[i], bit);
}
}
void loop()
{
for(int cnt=0; cnt<12; cnt++)
{
escreveDisplay(cnt);
delay(1000);
}
}