// Vector para las filas con su numero de pin
const int fila[5] = {
  2, 3, 4, 5, 6
};
// Vector para las columnas con su numero de pin
const int columna[3] = {
  7, 8, 9
};
int punto [5][3]   =  {
  {0, 0, 0},
  {0, 0, 0},
  {0, 0, 0},
  {0, 0, 0},
  {0, 1, 0}
};
int dece0 [5][3]   =  {
  {0, 0, 1},
  {0, 1, 1},
  {0, 0, 0},
  {0, 1, 1},
  {0, 0, 1}
};
int dece1 [5][3]   =  {
  {0, 0, 0},
  {0, 1, 0},
  {0, 0, 0},
  {0, 1, 0},
  {0, 0, 0}
};
int dece2 [5][3]   =  {
  {0, 0, 1},
  {0, 1, 0},
  {0, 0, 1},
  {0, 0, 1},
  {0, 0, 1}
};
int dece3 [5][3]   =  {
  {0, 0, 1},
  {0, 1, 0},
  {0, 0, 1},
  {0, 1, 0},
  {0, 0, 1}
};
int dece4 [5][3]   =  {
  {0, 0, 0},
  {0, 1, 1},
  {0, 0, 1},
  {0, 1, 0},
  {0, 0, 0}
};
int dece5 [5][3]   =  {
  {0, 0, 1},
  {0, 0, 1},
  {0, 0, 1},
  {0, 1, 0},
  {0, 0, 1}
};
int dece6 [5][3]   =  {
  {0, 0, 1},
  {0, 0, 1},
  {0, 0, 1},
  {0, 1, 1},
  {0, 0, 1}
};
int uni0 [5][3]   =   {
  {1, 1, 0},
  {1, 0, 0},
  {0, 1, 0},
  {1, 0, 0},
  {1, 0, 0}
};
int uni1 [5][3]   =   {
  {0, 0, 0},
  {1, 0, 0},
  {0, 0, 0},
  {1, 0, 0},
  {0, 0, 0}
};
int uni2 [5][3]   =   {
  {1, 0, 0},
  {1, 0, 0},
  {1, 1, 0},
  {0, 0, 0},
  {1, 0, 0}
};
int uni3 [5][3]   =   {
  {1, 0, 0},
  {1, 0, 0},
  {1, 0, 0},
  {1, 0, 0},
  {1, 0, 0}
};
int uni4 [5][3]   =   {
  {0, 1, 0},
  {1, 0, 0},
  {1, 0, 0},
  {1, 0, 0},
  {0, 0, 0}
};
int uni5 [5][3]   =   {
  {1, 1, 0},
  {0, 0, 0},
  {1, 0, 0},
  {1, 0, 0},
  {1, 0, 0}
};
int uni6 [5][3]   =   {
  {1, 1, 0},
  {0, 0, 0},
  {1, 1, 0},
  {1, 0, 0},
  {1, 0, 0}
};
int uni7 [5][3]   =   {
  {1, 0, 0},
  {1, 0, 0},
  {0, 0, 0},
  {1, 0, 0},
  {0, 0, 0}
};
int uni8 [5][3]   =   {
  {1, 1, 0},
  {1, 0, 0},
  {1, 1, 0},
  {1, 0, 0},
  {1, 0, 0}
};
int uni9 [5][3]   =   {
  {1, 1, 0},
  {1, 0, 0},
  {1, 0, 0},
  {1, 0, 0},
  {1, 0, 0}
};
void setup() {
  // inicializa los pines como salidas con los vectores columna y fila
  for (int i = 0; i < 5; i++) {
    pinMode(columna[i], OUTPUT);
    pinMode(fila[i], OUTPUT);
    // mi matriz es catodo comun, asi que pongo en high todas las columnas (catodos)
    digitalWrite(columna[i], HIGH);
  }
}
int cuenta = 24; 
int inicioCta = 24;
void loop() {
  dibujar(uni9) ;
}
void dibujar(int caracter[5][3]) {
  for (int i = 0; i < 5; i++) {
    digitalWrite(fila[i], HIGH);
    for (int j = 0; j < 3; j++) {
      if (caracter[i][j] == 1) {
        digitalWrite(columna[j], LOW);
      }
    }
    delay(20);
    digitalWrite(fila[i], LOW);
    for (int j = 0; j < 3; j++)  {
      digitalWrite(columna[j], HIGH);
    }
  }
}