Paso 13: codificación
Califique este instructable si te gusta! Aquí está el código que usé para que puede copiar y pegar:
< pre >
k #include & nbsp; & lt;avr/pgmspace.h & gt; & nbsp; < span estilo = "color: #7E7E7E;" > / / permite el uso de PROGMEM para almacenar patrones de flash < /span >
#define & nbsp; CUBESIZE & nbsp; 4
#define & nbsp; PLANESIZE & nbsp; CUBESIZE * CUBESIZE
#define & nbsp; PLANETIME & nbsp; 3333 & nbsp; < span estilo = "color: #7E7E7E;" > / / tiempo de cada plano se muestra en nosotros - & gt; 100 Hz actualizar < /span >
#define & nbsp; TIMECONST & nbsp; 20 & nbsp; < span estilo = "color: #7E7E7E;" > / / multiplica DisplayTime para obtener ms - = ¿por qué no 100? < /span >
< span estilo = "color: #7E7E7E;" > / / & nbsp; LED & nbsp; Patrón de & nbsp; Mesa & nbsp; en & nbsp; PROGMEM & nbsp;-& nbsp; último & nbsp; columna & nbsp; es & nbsp; pantalla & nbsp; tiempo & nbsp; en & nbsp; 100ms & nbsp; unidades < /span >
< span estilo = "color: #7E7E7E;" > / / & nbsp; TODO & nbsp; este & nbsp; podría & nbsp; ser & nbsp; a & nbsp; mucho & nbsp; más de & nbsp; compacto & nbsp; pero & nbsp; no & nbsp con & nbsp; binario & nbsp; patrón & nbsp; representación < /span >
prog_uchar & nbsp; PROGMEM & nbsp; PatternTable [] & nbsp; = & nbsp; {
< span estilo = "color: #7E7E7E;" > / / & nbsp; blink & nbsp; en & nbsp; y & nbsp; off < / span >
B0001 B0000 B0000, B0000, B0001, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0011 B0000 B0000, B0000, B0011, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0011 B0010, B0000, B0000, B0011, B0010, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0011 B0011 B0000, B0000, B0011, B0011, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0110 B0110 B0000, B0000, B0110, B0110, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0110, B0110, B0000, B0000, B0110, B0110, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0110, B0110, B0000, B0000, B0110, B0110, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0110, B0110, B0000, B0000, B0110, B0110, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0011, B0011, B0000, B0000, B0011, B0011, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0001, B0011, B0111, B0000, B0001, B0011, B0111, B0000, B0000, B0001, B0011, 10,
B0000 B0000 B0000, B0000, B0000, B0011, B0111, B0111, B0000, B0011, B0111, B0111, B0000, B0001, B0011, B0111, 10,
B0000 B0000 B0000, B0000, B0000, B0111, B0111, B0111, B0000, B0111, B0111, B0111, B0000, B0011, B0111, B0111, 10,
B0000 B0000 B0000, B0000, B0000, B0111, B0111, B0111, B0000, B0111, B0111, B0111, B0000, B0111, B0111, B0111, 10,
B0000 B0000 B0000, B0000, B0000, B1110, B1110, B1110, B0000, B1110, B1110, B1110, B0000, B1110, B1110, B1110, 10,
B0000 B1110, B1110, B1110, B0000, B1110, B1110, B1110, B0000, B1110, B1110, B1110, B0000, B0000, B0000, B0000, 10,
B0000 B1110, B1110, B1110, B0000, B1110, B1110, B1110, B0000, B1100, B1110, B1110, B0000, B0000, B0000, B0000, 10,
B0000 B1110, B1110, B1110, B0000, B1100, B1110, B1110, B0000, B1000, B1100, B1110, B0000, B0000, B0000, B0000, 10,
B0000 B1100, B1110, B1110, B0000, B1000, B1100, B1110, B0000, B0000, B1000, B1100, B0000, B0000, B0000, B0000, 10,
B0000 B1000, B1100, B1110, B0000, B0000, B1000, B1100, B0000, B0000, B0000, B1000, B0000, B0000, B0000, B0000, 10,
B0000 B0000, B1000, B1100, B0000, B0000, B0000, B1000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B1000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000, B1000, B1000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B1000 B1000, B1000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1000 B1000 B1000, B1000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1100 B1000 B1000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1110, B1000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1110 B0000 B0000, B0000, B0010, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0110 B0000 B0000, B0000, B0011, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0010 B0000 B0000, B0000, B0011, B0001, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0011, B0001, B0001, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0001, B0001, B0001, B0001, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0001, B0001, B0011, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0001, B0111, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B1111, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B1110, B0000, B0000, B0000, B1000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B1100, B0000, B0000, B1000, B1000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B1000, B0000, B0000, B1100, B1000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B1110, B1000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B1111, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0001, B0111, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0001, B0001, B0011, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0001, B0001, B0001, B0000, B0001, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0001, B0001, B0000, B0000, B0011, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0001, B0000, B0000, B0000, B0111, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B1111, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B1110, B1000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B1100, B1100, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B1000, B1110, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B1111, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0001, B0000, B0000, B0000, B0111, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0001, B0000, B0000, B0000, B0001, B0000, B0000, B0000, B0011, B0000, B0000, 10,
B0000 B0001, B0000, B0000, B0000, B0001, B0000, B0000, B0000, B0001, B0000, B0000, B0000, B0001, B0000, B0000, 10,
B0001 B0001, B0000, B0000, B0000, B0001, B0000, B0000, B0000, B0001, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0011 B0001, B0000, B0000, B0000, B0001, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0111 B0001, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1100, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1110, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1111 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1111 B0001, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1111 B0011, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1111 B0111, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1111 B1111, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1111 B1111, B1000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1111 B1111, B1100, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1111 B1111, B1110, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1111 B1111, B1111, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1111 B1111, B1111, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0111 B0111 B0111, B0111, B1000, B1000, B1000, B1000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0011 B0011 B0011, B0011, B0100, B0100, B0100, B0100, B1000, B1000, B1000, B1000, B0000, B0000, B0000, B0000, 10,
B0001 B0001, B0001, B0001, B0010, B0010, B0010, B0010, B0100, B0100, B0100, B0100, B1000, B1000, B1000, B1000, 10,
B0001 B0001, B0001, B0001, B0001, B0001, B0001, B0001, B0010, B0010, B0010, B0010, B0100, B0100, B0100, B0100, 10,
B0001 B0001, B0001, B0001, B0001, B0001, B0001, B0001, B0001, B0001, B0001, B0001, B0010, B0010, B0010, B0010, 10,
B0001 B0001, B0001, B0001, B0001, B0001, B0001, B0001, B0001, B0001, B0001, B0001, B0001, B0001, B0001, B0001, 10,
B0010 B0001, B0001, B0001, B0010, B0001, B0001, B0001, B0010, B0001, B0001, B0001, B0010, B0001, B0001, B0001, 10,
B0100 B0010, B0001, B0001, B0100, B0010, B0001, B0001, B0100, B0010, B0001, B0001, B0100, B0010, B0001, B0001, 10,
B1000 B0100 B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, 10,
B0000 B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, 10,
B0000 B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, 10,
B0001 B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, 10,
B0010 B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, 10,
B0100 B0100 B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, 10,
B1000 B0100 B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, 10,
B0000 B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, 10,
B0000 B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, 10,
B0001 B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, 10,
B1000 B0100 B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, 10,
B0000 B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, 10,
B0000 B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, 10,
B0001 B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, 10,
B0010 B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, 10,
B0100 B0100 B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, 10,
B1000 B0100 B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, 10,
B0000 B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, 10,
B0000 B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, 10,
B0001 B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, 10,
B1000 B0100 B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, 10,
B0000 B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, 10,
B0000 B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, 10,
B0001 B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, 10,
B0010 B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, 10,
B0100 B0100 B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, 10,
B1000 B0100 B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, 10,
B0000 B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, 10,
B0000 B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, 10,
B0001 B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, 10,
B1000 B0100 B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, 10,
B0000 B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, 10,
B0000 B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, 10,
B0001 B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, 10,
B0010 B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, 10,
B0100 B0100 B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, 10,
B1000 B0100 B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, 10,
B0000 B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, 10,
B0000 B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, 10,
B0001 B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, 10,
B1000 B0100 B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, 10,
B0000 B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, 10,
B0000 B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, 10,
B0001 B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, 10,
B0010 B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, 10,
B0100 B0100 B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, 10,
B1000 B0100 B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, 10,
B0000 B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, 10,
B0000 B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, 10,
B0001 B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, 10,
B1000 B0100 B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, 10,
B0000 B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, 10,
B0000 B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, 10,
B0001 B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, 10,
B0010 B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, 10,
B0100 B0100 B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, B0100, B0100, B0010, B0010, 10,
B1000 B0100 B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, B1000, B0100, B0010, B0001, 10,
B0000 B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, B0000, B1100, B0011, B0000, 10,
B0000 B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, B0000, B0011, B1100, B0000, 10,
B0001 B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, 10,
B0000 B0010, B0100, B0000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, 10,
B0000 B0000 B0000, B0000, B0000, B0010, B0100, B0000, B0001, B0010, B0100, B1000, B0001, B0010, B0100, B1000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0010, B0100, B0000, B0001, B0010, B0100, B1000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0010, B0100, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B1000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B1000, B0000, B0010, B0000, B1000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B1000, B0000, B0010, B0000, B1000, B0000, B0010, B1000, B0000, 10,
B0000 B0000 B0000, B1000, B0000, B0010, B0000, B1000, B0000, B0010, B1000, B0000, B0000, B0000, B1000, B0000, 10,
B0000 B0010, B0000, B1000, B0000, B0010, B1000, B0000, B0000, B0000, B1000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0010, B1000, B0000, B0000, B0000, B1000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000, B1000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0100 B0010, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0110 B0110, B0000, B0000, B0100, B0010, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1001 B0110 B0110, B1001, B0000, B0110, B0110, B0000, B0000, B0100, B0010, B0000, B0000, B0000, B0000, B0000, 10,
B1101 B0111, B1110, B1011, B1001, B0110, B0110, B1001, B0000, B0110, B0110, B0000, B0000, B0100, B0010, B0000, 10,
B1111 B1111 B1111, B1111, B1101, B0111, B1110, B1011, B1001, B0110, B0110, B1001, B0000, B0110, B0110, B0000, 10,
B1111 B1111 B1111, B1111, B1111, B1111, B1111, B1111, B1101, B0111, B1110, B1011, B1001, B0110, B0110, B1001, 10,
B1111 B1111 B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1101, B0111, B1110, B1011, 10,
B1111 B1111 B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1111 B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, 10,
B1111 B1111 B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B0000, B0000, B0000, B0000, 10,
B1111 B1111 B1111, B1111, B1111, B1111, B1111, B1111, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B1111 B1111 B1111, B1111, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
B0000 B0000 B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 10,
< span estilo = "color: #7E7E7E;" > / / & nbsp; este & nbsp; es & nbsp; a & nbsp; muñeco & nbsp; elemento & nbsp; para & nbsp; final & nbsp; de & nbsp; mesa & nbsp;(duration=0) & nbsp; aka & nbsp;! DO & nbsp; NO & nbsp; TOQUE!!!!!! < /span >
B0000 & nbsp; B0000 & nbsp; B0000 & nbsp; B0000 & nbsp; B0000 & nbsp; B0000 & nbsp; B0000 & nbsp; B0000 & nbsp; B0000 & nbsp; B0000 & nbsp; B0000 & nbsp; B0000 & nbsp; B0000 & nbsp; B0000 & nbsp; B0000 & nbsp; B0000, & nbsp; 0
};
< span estilo = "color: #7E7E7E;" > / * < /span >
< span estilo = "color: #7E7E7E;" > ** & nbsp; definir & nbsp; pernos & nbsp; en & nbsp; array & nbsp; hace & nbsp; & nbsp; más fácil & nbsp; a & nbsp; reorganizar & nbsp; cómo & nbsp; cubo & nbsp; es & nbsp; por cable < / span >
< span estilo = "color: #7E7E7E;" > ** & nbsp; Ajuste & nbsp; números & nbsp; Aquí & nbsp; hasta que & nbsp; LEDs & nbsp; flash & nbsp; en & nbsp; orden & nbsp;-& nbsp; L & nbsp; a & nbsp; R & nbsp; T & nbsp; a & nbsp; B < /span >
< span estilo = "color: #7E7E7E;" > ** & nbsp; Nota & nbsp; que & nbsp; analógico & nbsp; entradas & nbsp; 0-5 & nbsp; son & nbsp; también & nbsp; digital & nbsp Productos & nbsp; 14-19. < /span >
< span estilo = "color: #7E7E7E;" > ** & nbsp; PIN & nbsp; DigitalOut0 & nbsp; (serie & nbsp; RX) & nbsp; y & nbsp; AnalogIn5 & nbsp; son & nbsp; izquierda & nbsp; abierto & nbsp para & nbsp; futuro & nbsp; aplicaciones < /span >
< span estilo = "color: #7E7E7E;" > * / < /span >
< span estilo = "color: #CC6600;" > Int < /span > LEDPin [] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
< span estilo = "color: #CC6600;" > Int < /span > [] PlanePin = {16, 17, 18, 19};
< span estilo = "color: #7E7E7E;" > / / & nbsp; inicialización < /span >
< span estilo = "color: #CC6600;" > void < / span >< span estilo = "color: #CC6600;" >< b > Configuración < /b >< / span >)
{
< span estilo = "color: #CC6600;" > int < /span > pin; < span estilo = "color: #7E7E7E;" > / / lazo Contador < /span >
< span estilo = "color: #7E7E7E;" > / / & nbsp; conjunto & nbsp; up & nbsp; LED & nbsp; pernos & nbsp; como & nbsp; salida & nbsp; (activo & nbsp; ALTA) < /span >
< span estilo = "color: #CC6600;" > para < / span > (pin = 0; pin & lt; PLANESIZE; PIN ++) {}
< span estilo = "color: #CC6600;" > pinMode < /span > (LEDPin [pin] < span estilo = "color: #006699;" > salida < /span >);
}
< span estilo = "color: #7E7E7E;" > / / & nbsp; conjunto & nbsp; up & nbsp; plano & nbsp; pernos & nbsp; como & nbsp; salidas & nbsp; (activo & nbsp; BAJO) < /span >
< span estilo = "color: #CC6600;" > para < / span > (pin = 0; pin & lt; CUBESIZE; PIN ++) {}
< span estilo = "color: #CC6600;" > pinMode < /span > (PlanePin [pin] < span estilo = "color: #006699;" > salida < /span >);
}
}
< span estilo = "color: #7E7E7E;" > / / & nbsp; pantalla & nbsp; patrón & nbsp; en & nbsp; & nbsp; de la tabla hasta que & nbsp; DisplayTime & nbsp; es & nbsp; cero & nbsp; (entonces & nbsp; repetición) < /span >
< span estilo = "color: #CC6600;" > void < / span >< span estilo = "color: #CC6600;" >< b > lazo < /b >< / span >)
{
< span estilo = "color: #7E7E7E;" > / / & nbsp; declarar & nbsp; variables < /span >
< span estilo = "color: #CC6600;" > Byte < /span > PatternBuf [PLANESIZE]; < span estilo = "color: #7E7E7E;" > / / guarda el patrón actual de PatternTable < /span >
< span estilo = "color: #CC6600;" > Int < /span > PatternIdx;
< span estilo = "color: #CC6600;" > Byte < /span > DisplayTime; < span estilo = "color: #7E7E7E;" > / / tiempo * 100ms para mostrar configuración de < /span >
< span estilo = "color: #CC6600;" > sin firmar < / span >< span estilo = "color: #CC6600;" > Largo < / span > EndTime;
< span estilo = "color: #CC6600;" > int < /span > plano; < span estilo = "color: #7E7E7E;" > / / contador de bucle para actualización de cubo < /span >
< span estilo = "color: #CC6600;" > int < /span > patbufidx; < span estilo = "color: #7E7E7E;" > / / índices que byte del buffer patrón < /span >
< span estilo = "color: #CC6600;" > int < /span > ledrow; < span estilo = "color: #7E7E7E;" > / / cuentas LEDs en actualización lazo < /span >
< span estilo = "color: #CC6600;" > int < /span > ledcol; < span estilo = "color: #7E7E7E;" > / / cuentas LEDs en actualización lazo < /span >
< span estilo = "color: #CC6600;" > int < /span > ledpin; < span estilo = "color: #7E7E7E;" > / / cuentas LEDs en actualización lazo < /span >
< span estilo = "color: #7E7E7E;" > / / & nbsp; inicializar & nbsp; PatternIdx & nbsp; a & nbsp; principio & nbsp; de & nbsp; patrón & nbsp; de la tabla < /span >
PatternIdx & nbsp; = & nbsp; 0;
< span estilo = "color: #7E7E7E;" > / / & nbsp; bucle & nbsp; sobre & nbsp; las entradas & nbsp; & nbsp; patrón & nbsp; tabla & nbsp;-& nbsp mientras que & nbsp; DisplayTime & gt; 0 < / span >
< span estilo = "color: #CC6600;" > hacer < /span > {}
< span estilo = "color: #7E7E7E;" > / / & nbsp; leer & nbsp; patrón & nbsp; de & nbsp; PROGMEM & nbsp; y & nbsp; save & nbsp; en & nbsp; array < /span >
memcpy_P (& nbsp; PatternBuf & nbsp; PatternTable + PatternIdx & nbsp; PLANESIZE & nbsp;);
PatternIdx & nbsp; += & nbsp; PLANESIZE;
< span estilo = "color: #7E7E7E;" > / / & nbsp; leer & nbsp; DisplayTime & nbsp; de & nbsp; PROGMEM & nbsp; y & nbsp; incremento & nbsp; índice < /span >
DisplayTime & nbsp; = & nbsp; pgm_read_byte_near( PatternTable & nbsp; + & nbsp; PatternIdx++ & nbsp;);
< span estilo = "color: #7E7E7E;" > / / & nbsp; cálculo & nbsp; EndTime & nbsp; & nbsp; corriente & nbsp; tiempo & nbsp;(ms) & nbsp; y & nbsp; DisplayTime < /span >
EndTime & nbsp; = & nbsp; < span estilo = "color: #CC6600;" > millis < /span > () + ((< span estilo = "color: #CC6600;" > sin firmar < / span >< span estilo = "color: #CC6600;" > largo < / span >) DisplayTime) * TIMECONST;
< span estilo = "color: #7E7E7E;" > / / & nbsp; bucle & nbsp; mientras que & nbsp; DisplayTime & gt; 0 & nbsp; y & nbsp; corriente & nbsp; tiempo & nbsp; & lt; & nbsp; EndTime < /span >
< span estilo = "color: #CC6600;" > mientras < /span > (< span estilo = "color: #CC6600;" > millis < /span > () & lt; EndTime) {}
patbufidx & nbsp; = & nbsp; 0; & nbsp; < span estilo = "color: #7E7E7E;" > / / reset contador al principio del búfer de índice < /span >
< span estilo = "color: #7E7E7E;" > / / & nbsp; bucle & nbsp sobre & nbsp; planos < /span >
< span estilo = "color: #CC6600;" > para < / span > (plano = 0; avión & lt; CUBESIZE; plano ++) {}
< span estilo = "color: #7E7E7E;" > / / & nbsp; vuelta & nbsp; anterior & nbsp; plano & nbsp; off < /span >
< span estilo = "color: #CC6600;" > Si < /span > (plano == 0) {}
< span estilo = "color: #CC6600;" > digitalWrite < /span > (PlanePin [CUBESIZE-1], < span estilo = "color: #006699;" > alta < / span >);
} & nbsp; < span estilo = "color: #CC6600;" > {} else < / span >
< span estilo = "color: #CC6600;" > digitalWrite < /span > (PlanePin [plano-1], < span estilo = "color: #006699;" > alta < / span >);
}
< span estilo = "color: #7E7E7E;" > / / & nbsp; carga & nbsp; corriente & nbsp; plano & nbsp; patrón & nbsp; datos & nbsp; en & nbsp; puertos < /span >
ledPin & nbsp; = & nbsp; 0;
< span estilo = "color: #CC6600;" > para < / span > (ledrow = 0; ledrow & lt; CUBESIZE; ledrow ++) {}
< span estilo = "color: #CC6600;" > para < / span > (ledcol = 0; ledcol & lt; CUBESIZE; ledcol ++) {}
< span estilo = "color: #CC6600;" > digitalWrite < /span > (LEDPin [ledpin ++], PatternBuf [patbufidx] & amp; (1 & lt; & lt; ledcol));
}
patbufidx ++;
}
< span estilo = "color: #7E7E7E;" > / / & nbsp; vuelta & nbsp; corriente & nbsp; plano & nbsp; en < / span >
< span estilo = "color: #CC6600;" > digitalWrite < /span > (PlanePin [avión], < span estilo = "color: #006699;" > bajo < /span >);
< span estilo = "color: #7E7E7E;" > / / & nbsp; retardo & nbsp; PLANETIME & nbsp; nos < /span >
< span estilo = "color: #CC6600;" > delayMicroseconds < /span > (PLANETIME);
} & nbsp; < span estilo = "color: #7E7E7E;" > / / avión < /span >
} & nbsp; < span estilo = "color: #7E7E7E;" > / / mientras & lt; EndTime < /span >
} & nbsp; < span estilo = "color: #CC6600;" > Mientras < /span > (DisplayTime & gt; 0); < span estilo = "color: #7E7E7E;" > / leer patrones hasta el momento = 0 qué extremo de señales < /span >
}
< / pre >