//A,B,C,D,E,F,G
int segmentos[]={2,3,4,5,6,7,8};
int retardo=1500;
int numero [10][7] =
{
//ABCDEFG
{1, 1, 1, 1, 1, 1, 0 },
{0, 1, 1, 0, 0, 0, 0 }, // 1
{1, 1, 0, 1, 1, 0, 1}, //2
{1, 1, 1, 1, 0, 0, 1}, // 3
{0, 1, 1, 0, 0, 1, 1}, // 4
{1, 0, 1, 1, 0, 1, 1}, //5
{1, 0, 1, 1, 1, 1, 1},//6
{1, 1, 1, 0, 0, 0, 0}, //7
{1, 1, 1, 1, 1, 1, 1}, // 8
{1, 1, 1, 1, 0, 1, 1}//9
};
void setup() {
for(int i=0; i<7; i++)//permite recorrer el array de a posicion 7-1
{
pinMode(segmentos[i], OUTPUT);
digitalWrite(segmentos[i], LOW);
} }
void loop() {
// put your main code here, to run repeatedly:
//cero();
for (int i=0; i< 10; i++) // de hasta 9
{
for (int j=0; j < 7; j++) //se recorren los 7 segmentos
{
digitalWrite(segmentos[j], numero [i][j]);}
delay(retardo);
}}