Created
January 24, 2020 01:40
-
-
Save parzibyte/5d36875c044278d2e6a5f458e2e527e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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