Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 24, 2020 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/5d36875c044278d2e6a5f458e2e527e6 to your computer and use it in GitHub Desktop.
Save parzibyte/5d36875c044278d2e6a5f458e2e527e6 to your computer and use it in GitHub Desktop.
byte figura[8];
int numeroFigura = 0;
for (int cuadritoX = 0; cuadritoX < 4; cuadritoX++) {
for (int cuadritoY = 0; cuadritoY < 2; cuadritoY++) {
for (int x = 0; x < 8; x++) {
int numero = 0;
int indice = cuadritoY == 0 ? x : (x + 8);
int inicio = cuadritoX * 5;
// Quién te conoce math.pow
if (prueba[indice][inicio + 0] == 1)numero += 16;
if (prueba[indice][inicio + 1] == 1)numero += 8;
if (prueba[indice][inicio + 2] == 1)numero += 4;
if (prueba[indice][inicio + 3] == 1)numero += 2;
if (prueba[indice][inicio + 4] == 1)numero += 1;
///
figura[x] = numero;
}
pantalla.createChar(numeroFigura, figura);
pantalla.setCursor(cuadritoX, cuadritoY); // X, Y
pantalla.write(byte(numeroFigura));
numeroFigura++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment