Babuino, tu amigo en Arduino

  • Antonio Robledinos Antón
  • Celtia Martín García
  • Daniel Muñoz Rivera
  • Jia Qi (Rocío) Chen Sun

PREPROYECTO

Como primera idea del proyecto, se decidió hacer un Tamagotchi convencional. Su nombre y el nombre del proyecto es Babuino. Se implementaría este juego a base de una pantalla donde se fuera mostrando a un mono realizando diversas actividades. El Objetivo del jugador será ayudarle, cuidarle y evitar que muera.

El Babuino puede realizar muchas actividades en diversas pantallas (recogidas en el menú): una Pantalla neutra, una Pantalla Comer, una Pantalla Ducha, una Pantalla Dormir, una Pantalla Dar Mimos, una Pantalla Jugar y una Pantalla Apagar.

También se creó un prototipo a papel de la caja que podría contenerlo, con medidas aproximadas a lo que íbamos a necesitar:

COMPONENTES Y PRESUPUESTO

  • Placa Arduino UNO
  • 2 PCB’s (Pequeñas) (COMPRADO)
  • Pantalla: HiLetgo 2.2 inch ILI9341 SPI TFT LCD Display 240×320 3.3V. SKU: MSP2202 (COMPRADO)
  • Oled Screen: LCD QAPASS 1602 5V
  • Timbre: KPE-827 KINGSTATE 5V
  • 3 Botones (COMPRADO)
  • Sensor HC-SR04
  • Madera de Marquetería (COMPRADO)
  • Cables (COMPRADO)
  • Resistencias (COMPRADO)

PRESUPUESTO TOTAL: 32,85€

DESARROLLO Y MONTAJE

Los primeros días, empezamos a crear la base del código. Se crearon las variables globales que controlan el hambre y las demás características de Babuino. También se hicieron pruebas con la pantalla OLED, en la que teníamos pensado que salieran las notificaciones de esas variables cuando alcanzaban cierto umbral.

Para controlarlas y probar su funcionamiento, usamos los 3 botones que nos venían con el kit de Arduino para hacer que se reseteasen si se pulsaban. La prueba resultó ser todo un éxito, y la base principal del programa quedó perfecta.

Para nuestro siguiente paso, tuvimos que encargar la pantalla. Una vez nos llegó, intentamos que funcionara. Sin embargo, hubo bastantes problemas con el código y el funcionamiento de la propia pantalla, cosa que nos tuvo ocupados varias semanas.

Probando la pantalla

Como primer problema, los tutoriales para conectarla que vimos no funcionaban. Este problema se acabó resolviendo, añadiendo salidas a GROUND y resistencias que faltaban y que no se especificaba en el tutorial.

Seguido a ello, las librerías necesarias para el funcionamiento de los programas de prueba daban fallos. Tras mucho buscar, encontramos un código de prueba que usaba ciertas librerías que sí funcionaban, y por fin pudimos ver en acción a nuestra pantalla.

Tras este gran logro, debatimos la manera de implementar los Sprites de Babuino. Había dos opciones principales: a mano en el código o usando la SD que soportaba la pantalla. Al no disponer de mucho espacio, y que la calidad gráfica y facilidad a la hora de desarrollar el código era mayor, nos hizo decantarnos por la segunda opción.

Sin embargo, la SD dio más problemas de lo que esperábamos. Primero, tuvimos que soldar los pines de la SD. Luego, al probarla, nunca funcionaba, solo mostraba unos extraños parpadeos y unas líneas por pantalla. Probamos durante dos semanas diferentes configuraciones, tutoriales de uso, vídeos… Al final, todo quedó en nada. Debido a la falta de tiempo, tuvimos que cambiar a la primera opción.

Soldando la SD

Al menos, aprovechamos el tiempo de otra manera: mejoramos el prototipo de papel a uno real, hecho digitalmente, que se puede ver a continuación:

Con este nuevo diseño, ya sabiendo todo lo que lleva, empezamos a construir la caja contenedora de Babuino. Se hizo con madera de marquetería. Está madera se cortó siguiendo las medidas correspondientes. 

Agujereando y lijando la madera

Volviendo a los Sprites, se empezaron a hacer a mano. Para ellos, usamos la página de apoyo  https://javl.github.io/image2cpp/, que convierte las imágenes en código monocolor. Por temas de memoria, estas imágenes tienen un tamaño limitado( 56×56 ). Con la memoria SD, se podría haber aprovechado el potencial de la pantalla, pero por temas de tiempo no ha podido ser.

Todos estos sprites se metieron en el código, se ordenaron y se probaron. Calibramos sus posiciones y seguimos añadiendo contenido. Para poder aprovechar todo el espacio de pantalla que teníamos desperdiciado, decidimos que nuestra criatura se mostraría aleatoriamente por toda la pantalla cada segundo. Ha de decirse que esta opción aumenta la memoria ocupada por el programa, quedándonos tan solo un 20% para lo que nos quedaba. 

Se añadió el código relativo a la música, que sonará cada vez que pulsemos un botón y su acción surta efecto, para indicarle al jugador que se ha ejecutado su orden.

Creando y metiendo la música

Conectadas las dos pantallas y los botones, con todo el código hecho, decidimos añadir el sensor para hacer el juego. Consistirá en que Babuino de saltos cuando se mueve la mano a una distancia determinada. 

Para la alimentación, se ha añadido también una pila, para que el juego sea portable. Para usarla, hemos medido el amperaje de todos los componentes y hemos comprado una pila adecuada. También, se ha añadido un interruptor, para apagar y encender el juego cuando se desee. La función de Apagar del menú no corta la alimentación, solo deja una pantalla en blanco en la que no se puede hacer nada.

Con todo esto hecho, nos quedó todo conectado:

Y lo metimos todo en la caja, que cerramos con silicona:

La caja puede abrirse por detrás mediante una bisagra, para poder observar y retirar fácilmente los componentes.

PROTOTIPO FINAL (SOFTWARE)

LIBRERÍAS

CÓDIGO

#include <LiquidCrystal_I2C.h>
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

//Define para Control
#define umbral 0.5
#define total 2.0

//Define para Música
#define LAG 146.000
#define SIG 196.000
#define DO 261.626 
#define RE 293.665
#define MI 330.628
#define FA 349.228
#define SOL 391.995 
#define LA 440.000
#define SI 493.883
#define DO2 523.251
#define DOS 554.37
#define FAS  369.99
#define REALTO 1174.66
#define RES 622.25
#define SOLS 415.30
#define REMEDIO 578.33
#define SILENCE 0.0
#define MIALTO 659.26
#define np 750
#define n 500
#define c 250
#define s 125

//Define para Colores de los bitmap
#define BLACK   0x0000
#define WHITE   0xFFFF
#define GREY    0xD6BA

//Define para Pines de la pantalla. Mosi, Miso y Sck trabajan con el bus SPI (pines 11 12 y 13) y no hace falta definirlos.
#define TFT_DC 8
#define TFT_CS 10
#define TFT_RST 9

LiquidCrystal_I2C lcd (0x3f,16,2);                                        //Pantalla Arriba

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);         //Pantalla Abajo

//Sistema
float cont_hambre = total;
float cont_suciedad = total;
float cont_mimos = total;
float cont_suenho = total;
bool in_men_hambre = false;
bool in_men_suciedad = false;
bool in_men_mimos = false;
bool in_men_suenho = false;
int x;
int y;

//Sprites del menu, convertidos de png a código gracias a la web https://javl.github.io/image2cpp/

static const uint8_t icon_comida [] PROGMEM = {
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x70, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0xf0, 0x00, 
0x01, 0x80, 0x00, 0x00, 0x07, 0xf0, 0x00, 0x01, 0x80, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x01, 0x80, 
0x00, 0x00, 0x1f, 0xf0, 0x00, 0x01, 0x80, 0x00, 0x00, 0x1f, 0xf0, 0x00, 0x01, 0x80, 0x00, 0x00, 
0x3f, 0xf0, 0x00, 0x01, 0x80, 0x00, 0x00, 0x3f, 0xe0, 0x00, 0x01, 0x80, 0x00, 0x00, 0x7f, 0xe0, 
0x00, 0x01, 0x80, 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x01, 0x80, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x01, 
0x80, 0x00, 0x00, 0x78, 0x00, 0x00, 0x01, 0x80, 0x00, 0xe0, 0x60, 0x0e, 0x00, 0x01, 0x80, 0x03, 
0xfc, 0x40, 0x7f, 0x80, 0x01, 0x80, 0x07, 0xff, 0x01, 0xff, 0xc0, 0x01, 0x80, 0x0f, 0xff, 0x87, 
0xff, 0xe0, 0x01, 0x80, 0x0f, 0xff, 0xff, 0xff, 0xe0, 0x01, 0x80, 0x1f, 0x1f, 0xff, 0xff, 0xf0, 
0x01, 0x80, 0x3e, 0x0f, 0xff, 0xff, 0xf8, 0x01, 0x80, 0x3c, 0x0f, 0xff, 0xff, 0xf8, 0x01, 0x80, 
0x38, 0x0c, 0xff, 0xff, 0xf8, 0x01, 0x80, 0x38, 0x08, 0xff, 0xff, 0xf8, 0x01, 0x80, 0x70, 0x1f, 
0xff, 0xff, 0xfc, 0x01, 0x80, 0x70, 0x1f, 0xff, 0xff, 0xfc, 0x01, 0x80, 0x70, 0x3f, 0xff, 0xff, 
0xfc, 0x01, 0x80, 0x78, 0x7f, 0xff, 0xff, 0xfc, 0x01, 0x80, 0x7f, 0xff, 0xff, 0xff, 0xfc, 0x01, 
0x80, 0x7f, 0xff, 0xff, 0xff, 0xfc, 0x01, 0x80, 0x7f, 0xff, 0xff, 0xff, 0xfc, 0x01, 0x80, 0x3f, 
0xff, 0xff, 0xff, 0xf8, 0x01, 0x80, 0x3f, 0xff, 0xff, 0xff, 0xf8, 0x01, 0x80, 0x1f, 0xff, 0xff, 
0xff, 0xf0, 0x01, 0x80, 0x0f, 0xff, 0xff, 0xff, 0xe0, 0x01, 0x80, 0x07, 0xff, 0xff, 0xff, 0xc0, 
0x01, 0x80, 0x07, 0xff, 0xff, 0xff, 0xc0, 0x01, 0x80, 0x03, 0xff, 0xff, 0xff, 0x80, 0x01, 0x80, 
0x01, 0xff, 0xff, 0xff, 0x00, 0x01, 0x80, 0x00, 0x7f, 0xff, 0xfc, 0x00, 0x01, 0x80, 0x00, 0x7f, 
0xff, 0xfc, 0x00, 0x01, 0x80, 0x00, 0x3f, 0xff, 0xf8, 0x00, 0x01, 0x80, 0x00, 0x0f, 0xff, 0xe0, 
0x00, 0x01, 0x80, 0x00, 0x03, 0xc7, 0x80, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 

};

static const uint8_t icon_dormir [] PROGMEM = {
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xc0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x03, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x0f, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xa4, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x04, 0x7f, 0xff, 0xff, 0xff, 0xff, 
0xfe, 0x2c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x39, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x03, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 
0x8f, 0xff, 0xff, 0xe0, 0x0f, 0xfe, 0x1f, 0x6f, 0xff, 0xff, 0xc0, 0x0f, 0xe1, 0xdf, 0xef, 0xff, 
0xff, 0xc0, 0x0f, 0xff, 0xbf, 0xdf, 0xff, 0xff, 0x80, 0x0f, 0xff, 0xbf, 0xc3, 0xff, 0xff, 0x80, 
0x27, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x06, 0xc3, 0xff, 0x7b, 0xff, 0xff, 0xff, 0x01, 0x01, 0xfe, 
0xe7, 0xff, 0xff, 0xff, 0x00, 0x00, 0xfe, 0x1f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7f, 0xff, 0xff, 
0xff, 0xfe, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xfe, 
0x24, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xfe, 0x42, 0x00, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xc1, 0x01, 
0xff, 0xff, 0xff, 0xff, 0xfe, 0x81, 0x83, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x81, 0x83, 0xff, 0xff, 
0xff, 0xff, 0xfe, 0x43, 0x03, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x67, 0x03, 0xff, 0xff, 0xff, 0xff, 
0xfe, 0x3c, 0x03, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 
0x03, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 
0xff, 0xfe, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xff, 0xe1, 
0xff, 0xff, 0x80, 0x00, 0x1f, 0xff, 0x03, 0xff, 0xff, 0xc0, 0x08, 0x07, 0xf8, 0x07, 0xff, 0xff, 
0xc0, 0x12, 0x00, 0x00, 0x07, 0xff, 0xff, 0xe0, 0x21, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x21, 
0x00, 0x00, 0x1f, 0xff, 0xff, 0xf8, 0x27, 0x00, 0x60, 0x3f, 0xff, 0xff, 0xfc, 0x3e, 0x00, 0x80, 
0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x43, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xff, 0xff, 
0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xfe, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff

};

static const uint8_t icon_mimos [] PROGMEM = {
 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 
0x81, 0xfc, 0x01, 0xfc, 0x00, 0x00, 0x01, 0x83, 0xfe, 0x03, 0xfe, 0x00, 0x00, 0x01, 0x87, 0xff, 
0x07, 0xff, 0x00, 0x00, 0x01, 0x8f, 0xff, 0x8f, 0xff, 0x80, 0x00, 0x01, 0x8f, 0xff, 0x8f, 0xff, 
0x80, 0x00, 0x01, 0x9f, 0xff, 0xdf, 0xff, 0xc0, 0x00, 0x01, 0x9f, 0xff, 0xdf, 0xff, 0xc0, 0x00, 
0x01, 0xbf, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x01, 0xbf, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x01, 0xbf, 
0xff, 0xff, 0xff, 0xe0, 0x00, 0x01, 0xbf, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x01, 0xbf, 0xff, 0xff, 
0xff, 0xe0, 0x00, 0x01, 0xbf, 0xff, 0xff, 0xff, 0xe1, 0xe1, 0xe1, 0xbf, 0xff, 0xff, 0xff, 0xe3, 
0xf3, 0xf1, 0xbf, 0xff, 0xff, 0xff, 0xe7, 0xff, 0xf9, 0x9f, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xf9, 
0x8f, 0xff, 0xff, 0xff, 0x87, 0xff, 0xf9, 0x87, 0xff, 0xff, 0xff, 0x07, 0xff, 0xf9, 0x83, 0xff, 
0xff, 0xfe, 0x07, 0xff, 0xf9, 0x81, 0xff, 0xff, 0xfc, 0x07, 0xff, 0xf9, 0x80, 0xff, 0xff, 0xf8, 
0x07, 0xff, 0xf9, 0x80, 0x7f, 0xff, 0xf0, 0x03, 0xff, 0xf1, 0x80, 0x3f, 0xff, 0xe0, 0x01, 0xff, 
0xe1, 0x80, 0x1f, 0xff, 0xc0, 0x00, 0xff, 0xc1, 0x80, 0x0f, 0xff, 0x80, 0x00, 0x7f, 0x81, 0x80, 
0x07, 0xff, 0x00, 0x00, 0x3f, 0x01, 0x80, 0x03, 0xfe, 0x00, 0x00, 0x1e, 0x01, 0x80, 0x01, 0xfc, 
0x00, 0x00, 0x0c, 0x01, 0x80, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x70, 0x00, 0x00, 
0x00, 0x01, 0x80, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff

};

static const uint8_t icon_duchar[] PROGMEM = {
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf8, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x01, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x01, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x1c, 0x00, 0x00, 0x00, 0x00, 
0x01, 0x83, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0xfe, 0x1f, 0xe0, 0x00, 0x00, 0x01, 0x80, 
0xfe, 0x7f, 0xf8, 0x00, 0x00, 0x01, 0x81, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x01, 0x81, 0xff, 0xff, 
0xff, 0x00, 0x00, 0x01, 0x81, 0xff, 0xff, 0xff, 0x00, 0x00, 0x01, 0x80, 0xff, 0xff, 0xff, 0x00, 
0x00, 0x01, 0x80, 0x3f, 0xff, 0xf8, 0x80, 0x00, 0x01, 0x80, 0x3f, 0xff, 0xe0, 0x40, 0x00, 0x01, 
0x80, 0x7f, 0xff, 0x80, 0x20, 0x00, 0x01, 0x80, 0x7f, 0xff, 0x00, 0x20, 0x00, 0x01, 0x80, 0xff, 
0xfc, 0x00, 0x10, 0x00, 0x01, 0x80, 0xff, 0xf8, 0x00, 0x08, 0x00, 0x01, 0x81, 0xff, 0xf0, 0x20, 
0x08, 0x00, 0x01, 0x81, 0xff, 0xe0, 0x10, 0x44, 0x00, 0x01, 0x81, 0xff, 0xc0, 0x10, 0x42, 0x00, 
0x01, 0x83, 0xff, 0x80, 0x08, 0x22, 0x00, 0x01, 0x83, 0xff, 0x00, 0x04, 0x11, 0x00, 0x01, 0x83, 
0xfc, 0x00, 0x04, 0x10, 0x80, 0x01, 0x83, 0xf8, 0x00, 0x02, 0x08, 0x40, 0x01, 0x83, 0xf0, 0x04, 
0x02, 0x08, 0x40, 0x01, 0x83, 0xc1, 0x04, 0x21, 0x04, 0x20, 0x01, 0x83, 0x80, 0x84, 0x20, 0x84, 
0x11, 0xf9, 0x83, 0x00, 0x82, 0x10, 0x82, 0x0b, 0x1d, 0x81, 0x00, 0x82, 0x08, 0x42, 0x04, 0x0f, 
0x80, 0x80, 0x41, 0x08, 0x42, 0x08, 0x07, 0x80, 0x80, 0x41, 0x04, 0x21, 0x08, 0x07, 0x80, 0x80, 
0x40, 0x84, 0x21, 0x18, 0x03, 0x80, 0x40, 0x20, 0x82, 0x10, 0x98, 0x03, 0x80, 0x40, 0x20, 0x42, 
0x10, 0x98, 0x03, 0x80, 0x40, 0x20, 0x42, 0x13, 0xfc, 0x03, 0x80, 0x20, 0x20, 0x21, 0x0f, 0xfe, 
0x07, 0x80, 0x20, 0x20, 0x20, 0x0e, 0x07, 0xff, 0x80, 0x20, 0x10, 0x10, 0x0c, 0x03, 0xff, 0x80, 
0x20, 0x10, 0x1f, 0x8c, 0x03, 0xff, 0x80, 0x20, 0x10, 0x3f, 0xcc, 0x03, 0xff, 0x80, 0x10, 0x10, 
0x38, 0xec, 0x03, 0xe3, 0x80, 0x10, 0x08, 0x60, 0x3c, 0x03, 0x81, 0x80, 0x10, 0x08, 0x40, 0x3e, 
0x03, 0x81, 0x80, 0x10, 0x08, 0x40, 0x3f, 0x07, 0x81, 0x80, 0x1e, 0x08, 0x40, 0x3f, 0xff, 0x81, 
0x80, 0x1f, 0xc3, 0xe0, 0x3f, 0x8f, 0x81, 0x80, 0x3b, 0xe7, 0xe0, 0x7f, 0x03, 0xa3, 0x80, 0x60, 
0x6e, 0xf0, 0xfe, 0x02, 0x0f, 0x80, 0x40, 0x30, 0x3e, 0x0c, 0x00, 0x03, 0x80, 0x40, 0x20, 0x1c, 
0x04, 0x00, 0x03, 0x80, 0x40, 0x20, 0x08, 0x00, 0x00, 0x03, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 
0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff 

};

static const uint8_t icon_jugar [] PROGMEM = {
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x07, 0xff, 0x00, 0x00, 0x00, 0x01, 0x80, 0x0f, 
0x07, 0xc0, 0x00, 0x00, 0x01, 0x80, 0x38, 0x00, 0xe0, 0x00, 0x00, 0x01, 0x80, 0x70, 0x00, 0x38, 
0x00, 0x00, 0x01, 0x80, 0xc0, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x81, 0x8c, 0x0c, 0x0c, 0x00, 0x00, 
0x01, 0x83, 0x12, 0x12, 0x06, 0x00, 0x00, 0x01, 0x83, 0x11, 0x22, 0x06, 0x00, 0x00, 0x01, 0x86, 
0x09, 0x24, 0x06, 0x00, 0x00, 0x01, 0x86, 0x06, 0x18, 0x06, 0x00, 0x00, 0x01, 0x86, 0x00, 0x00, 
0x06, 0x00, 0x00, 0x01, 0x86, 0x00, 0x00, 0x06, 0x00, 0x00, 0x01, 0x86, 0x06, 0x18, 0x06, 0x00, 
0x00, 0x01, 0x86, 0x09, 0x24, 0x06, 0x00, 0x00, 0x01, 0x86, 0x11, 0x22, 0x03, 0x00, 0x00, 0x01, 
0x86, 0x12, 0x12, 0x03, 0x80, 0x00, 0x01, 0x86, 0x0c, 0x0c, 0x00, 0xc0, 0x00, 0x01, 0x86, 0x00, 
0x00, 0x00, 0xe0, 0x00, 0x01, 0x83, 0x00, 0x00, 0x00, 0x70, 0x00, 0x01, 0x83, 0x00, 0x00, 0x70, 
0x38, 0x00, 0x01, 0x83, 0x00, 0x00, 0x88, 0x1c, 0x00, 0x01, 0x81, 0x80, 0x00, 0x88, 0x0f, 0xf8, 
0x01, 0x80, 0xc0, 0x00, 0x88, 0x07, 0xfe, 0x01, 0x80, 0x78, 0x02, 0x70, 0x00, 0x07, 0x81, 0x80, 
0x3f, 0xff, 0x03, 0x80, 0x01, 0xc1, 0x80, 0x07, 0xff, 0x84, 0x40, 0x00, 0x61, 0x80, 0x00, 0x03, 
0xc4, 0x40, 0x00, 0x31, 0x80, 0x00, 0x01, 0xe4, 0x40, 0x00, 0x19, 0x80, 0x00, 0x01, 0xf3, 0x80, 
0x00, 0x0d, 0x80, 0x00, 0x03, 0xf8, 0x0e, 0x1c, 0x0d, 0x80, 0x00, 0x07, 0xbc, 0x1f, 0x3e, 0x07, 
0x80, 0x00, 0x07, 0x1e, 0x1f, 0x3e, 0x07, 0x80, 0x00, 0x0f, 0x0c, 0x1f, 0x3e, 0x07, 0x80, 0x00, 
0x1e, 0x0c, 0x0e, 0x1c, 0x07, 0x80, 0x00, 0x7c, 0x0c, 0x00, 0x00, 0x07, 0x80, 0x00, 0xf8, 0x0c, 
0x00, 0x00, 0x07, 0x80, 0x07, 0xf0, 0x0c, 0x0e, 0x1c, 0x0d, 0x80, 0x1f, 0xc0, 0x0c, 0x1f, 0x3e, 
0x0d, 0x80, 0x7f, 0x00, 0x0c, 0x1f, 0x3e, 0x19, 0x81, 0xfc, 0x00, 0x0c, 0x1f, 0x3e, 0x19, 0x83, 
0xe0, 0x00, 0x0c, 0x0e, 0x1c, 0x31, 0x8f, 0x80, 0x00, 0x06, 0x00, 0x00, 0x31, 0x9f, 0x00, 0x00, 
0x06, 0x00, 0x00, 0x61, 0xbe, 0x00, 0x00, 0x03, 0x00, 0x00, 0xc1, 0xfc, 0x00, 0x00, 0x01, 0xc0, 
0x01, 0x81, 0xf8, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x01, 0xf0, 0x00, 0x00, 0x00, 0x38, 0x1e, 0x01, 
0xe0, 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x01, 0xc0, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff 

};

static const uint8_t icon_apagar [] PROGMEM = {
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x18, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x3c, 0x00, 0x00, 
0x01, 0x80, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x01, 0x80, 
0x00, 0x00, 0x7e, 0x00, 0x00, 0x01, 0x80, 0x03, 0xc0, 0x7e, 0x03, 0xc0, 0x01, 0x80, 0x07, 0xe0, 
0x7e, 0x07, 0xf0, 0x01, 0x80, 0x0f, 0xf0, 0x7e, 0x0f, 0xf8, 0x01, 0x80, 0x1f, 0xf0, 0x7e, 0x0f, 
0xfc, 0x01, 0x80, 0x3f, 0xe0, 0x7e, 0x07, 0xfe, 0x01, 0x80, 0x7f, 0xc0, 0x7e, 0x03, 0xfe, 0x01, 
0x80, 0xff, 0x00, 0x7e, 0x00, 0xff, 0x01, 0x80, 0xfe, 0x00, 0x7e, 0x00, 0x7f, 0x01, 0x80, 0xfc, 
0x00, 0x7e, 0x00, 0x3f, 0x01, 0x81, 0xfc, 0x00, 0x7e, 0x00, 0x3f, 0x81, 0x81, 0xf8, 0x00, 0x7e, 
0x00, 0x1f, 0x81, 0x81, 0xf8, 0x00, 0x7e, 0x00, 0x1f, 0x81, 0x81, 0xf8, 0x00, 0x7e, 0x00, 0x1f, 
0x81, 0x83, 0xf0, 0x00, 0x3c, 0x00, 0x0f, 0xc1, 0x83, 0xf0, 0x00, 0x3c, 0x00, 0x0f, 0xc1, 0x83, 
0xf0, 0x00, 0x00, 0x00, 0x0f, 0xc1, 0x83, 0xf0, 0x00, 0x00, 0x00, 0x0f, 0xc1, 0x83, 0xf0, 0x00, 
0x00, 0x00, 0x0f, 0xc1, 0x83, 0xf0, 0x00, 0x00, 0x00, 0x0f, 0xc1, 0x83, 0xf0, 0x00, 0x00, 0x00, 
0x0f, 0xc1, 0x83, 0xf0, 0x00, 0x00, 0x00, 0x0f, 0xc1, 0x83, 0xf0, 0x00, 0x00, 0x00, 0x0f, 0xc1, 
0x81, 0xf8, 0x00, 0x00, 0x00, 0x1f, 0x81, 0x81, 0xfc, 0x00, 0x00, 0x00, 0x3f, 0x81, 0x81, 0xfc, 
0x00, 0x00, 0x00, 0x3f, 0x81, 0x80, 0xfe, 0x00, 0x00, 0x00, 0x7f, 0x01, 0x80, 0xff, 0x00, 0x00, 
0x00, 0xff, 0x01, 0x80, 0xff, 0x80, 0x00, 0x01, 0xff, 0x01, 0x80, 0x7f, 0xe0, 0x00, 0x07, 0xfe, 
0x01, 0x80, 0x7f, 0xf8, 0x00, 0x1f, 0xfe, 0x01, 0x80, 0x3f, 0xfe, 0x00, 0x7f, 0xfc, 0x01, 0x80, 
0x1f, 0xff, 0xff, 0xff, 0xf8, 0x01, 0x80, 0x1f, 0xff, 0xff, 0xff, 0xf8, 0x01, 0x80, 0x0f, 0xff, 
0xff, 0xff, 0xf0, 0x01, 0x80, 0x07, 0xff, 0xff, 0xff, 0xe0, 0x01, 0x80, 0x03, 0xff, 0xff, 0xff, 
0xc0, 0x01, 0x80, 0x01, 0xff, 0xff, 0xff, 0x80, 0x01, 0x80, 0x00, 0x7f, 0xff, 0xfe, 0x00, 0x01, 
0x80, 0x00, 0x1f, 0xff, 0xf8, 0x00, 0x01, 0x80, 0x00, 0x07, 0xff, 0xe0, 0x00, 0x01, 0x80, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff

};

//Sprites de babuino

static const uint8_t b_normal [] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x07, 0xff, 0xc0, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0xff, 0xf0, 0x1e, 0x00, 0x01, 0xf8, 0x7f, 
0xff, 0xf8, 0x3f, 0x00, 0x03, 0x0c, 0xff, 0xff, 0xfe, 0x61, 0x80, 0x06, 0x0d, 0xff, 0xff, 0xff, 
0x60, 0xc0, 0x06, 0x07, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0x06, 0x07, 0xff, 0xff, 0xff, 0xc0, 0xc0, 
0x06, 0x07, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0x06, 0x07, 0xf3, 0xff, 0x8f, 0xc0, 0xc0, 0x06, 0x07, 
0xe0, 0xfe, 0x07, 0xc0, 0xc0, 0x06, 0x07, 0xc0, 0x7c, 0x03, 0xc0, 0xc0, 0x06, 0x07, 0x8c, 0x10, 
0x63, 0xc0, 0xc0, 0x06, 0x07, 0x8c, 0x00, 0x63, 0xe0, 0xc0, 0x03, 0x07, 0x9e, 0x00, 0xf3, 0xe1, 
0x80, 0x03, 0x0f, 0x9e, 0x00, 0xf3, 0xe1, 0x80, 0x03, 0x1f, 0xcc, 0x00, 0x67, 0xf1, 0x80, 0x01, 
0xff, 0xe0, 0x00, 0x0f, 0xff, 0x00, 0x00, 0xff, 0xf0, 0x00, 0x1f, 0xfe, 0x00, 0x00, 0x3f, 0xfc, 
0x00, 0x7f, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0x01, 0xff, 0xf0, 0x00, 0x00, 0x3f, 0xff, 0x81, 0xff, 
0xf0, 0x00, 0x00, 0x3f, 0xff, 0x83, 0xff, 0xf0, 0x00, 0x00, 0x1f, 0xff, 0xc3, 0xff, 0xf0, 0x00, 
0x08, 0x1f, 0xff, 0xc7, 0xff, 0xe0, 0x00, 0x1e, 0x1f, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x3f, 0x0f, 
0xff, 0xff, 0xff, 0xc0, 0x00, 0x7f, 0x87, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x7f, 0x07, 0xff, 0xff, 
0xff, 0x80, 0x00, 0x7a, 0x07, 0xff, 0xff, 0xff, 0x80, 0x00, 0x78, 0x0f, 0xff, 0xff, 0xff, 0x80, 
0x00, 0x78, 0x0f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7c, 0x3f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x3f, 
0xfe, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x1f, 0xfc, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xf8, 0x7f, 
0xef, 0xfc, 0x00, 0x00, 0x07, 0xf0, 0x7f, 0xef, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xef, 0xf8, 
0x00, 0x00, 0x00, 0x00, 0x3f, 0xef, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xef, 0xf0, 0x00, 0x00, 
0x00, 0x00, 0x1f, 0xef, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xef, 0xe0, 0x00, 0x00, 0x00, 0x00, 
0x0f, 0xc7, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

};

static const uint8_t b_hambre [] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3f, 0xf0, 0x00, 0x0e, 
0x00, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x1c, 0x00, 0x00, 0x01, 0xff, 0xff, 0x00, 0x3c, 0x00, 0x00, 
0x01, 0xff, 0xff, 0x80, 0x78, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x80, 0x78, 0x00, 0x00, 0x00, 0xf0, 
0x0f, 0xc0, 0x70, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x70, 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 
0x78, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xe0, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xe0, 0x7e, 0x00, 
0x00, 0x00, 0x00, 0x07, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x3f, 0xc0, 0x00, 0x00, 
0x00, 0x1f, 0xc0, 0x1f, 0xe0, 0x00, 0x00, 0x00, 0x1f, 0x80, 0x0f, 0xe0, 0x00, 0x00, 0x00, 0x3f, 
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x80, 0x00, 0x00, 0x00, 
0x00, 0x07, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x7f, 
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x7d, 0xff, 0xff, 0xff, 
0xc7, 0x00, 0x00, 0xef, 0xe7, 0xff, 0xff, 0xfd, 0x80, 0x00, 0xc7, 0xe7, 0xff, 0xff, 0xf9, 0xc0, 
0x00, 0xc7, 0xc3, 0xff, 0xff, 0xf8, 0xe0, 0x00, 0x8f, 0xc3, 0xff, 0xff, 0xf8, 0xe0, 0x00, 0x8f, 
0xc3, 0xff, 0xff, 0xf8, 0xc0, 0x00, 0x8f, 0xe7, 0xff, 0xff, 0xf8, 0x40, 0x00, 0x8f, 0xff, 0xff, 
0xff, 0xf8, 0x40, 0x01, 0x8f, 0xff, 0xff, 0xff, 0xf0, 0x60, 0x00, 0x8f, 0xff, 0xff, 0xf7, 0xf8, 
0xe0, 0x01, 0x8f, 0xff, 0xff, 0xe3, 0xf0, 0xc0, 0x00, 0xcf, 0xff, 0xff, 0xe1, 0xf9, 0xc0, 0x00, 
0xff, 0xff, 0xff, 0xe1, 0xef, 0x80, 0x00, 0x39, 0xff, 0xff, 0xe3, 0xc0, 0x00, 0x00, 0x00, 0xff, 
0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xfe, 
0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 

};

static const uint8_t b_suenho [] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x01, 0xc1, 0xc0, 0x00, 0x00, 0x00, 0x07, 0x1f, 0xcf, 0xc0, 0x00, 0x00, 
0x00, 0x7e, 0x3d, 0xc8, 0xc0, 0x00, 0x00, 0x03, 0xfe, 0x01, 0x81, 0x80, 0x00, 0x00, 0x01, 0x8e, 
0x03, 0x81, 0x80, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x03, 
0xf0, 0x00, 0x00, 0x00, 0x1c, 0x03, 0x13, 0x80, 0x00, 0x00, 0x00, 0x1c, 0x07, 0xf8, 0x00, 0x00, 
0x00, 0x00, 0x38, 0x47, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x3f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xe1, 0xc0, 0x00, 
0x00, 0x00, 0x3f, 0xff, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xfe, 0x60, 0x00, 0x00, 0x00, 
0xff, 0xff, 0xfe, 0x30, 0x00, 0x00, 0x01, 0xff, 0xff, 0xfe, 0x30, 0x00, 0x00, 0x01, 0xff, 0xfc, 
0x0f, 0x30, 0x00, 0x00, 0x1b, 0xff, 0xf8, 0x07, 0x10, 0x00, 0x00, 0x3f, 0xff, 0xf0, 0x07, 0x90, 
0x00, 0x00, 0x6f, 0xc3, 0xe0, 0x07, 0x98, 0x00, 0x00, 0xc7, 0x80, 0x00, 0x03, 0x90, 0x00, 0x00, 
0xc7, 0x80, 0x00, 0x33, 0xd0, 0x00, 0x00, 0xc3, 0x00, 0x06, 0x63, 0xf0, 0x00, 0x00, 0xc3, 0x01, 
0x87, 0xe3, 0xe0, 0x00, 0x00, 0x83, 0x03, 0x00, 0x03, 0xc0, 0x00, 0x00, 0xc3, 0x3e, 0x00, 0x07, 
0xc0, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x63, 0x80, 0x00, 0x0f, 0xc0, 0x00, 
0x00, 0x3f, 0x80, 0x30, 0x0f, 0xc0, 0x00, 0x00, 0x1f, 0xc0, 0x30, 0x3f, 0x80, 0x00, 0x00, 0x0b, 
0xe0, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x01, 0xfc, 0x00, 0x7f, 0x80, 0x00, 0x00, 0x01, 0xff, 0x87, 
0xff, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0x00, 
0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1f, 0xc0, 0x7f, 
0xff, 0xff, 0x00, 0x00, 0x1f, 0x80, 0x7f, 0xff, 0xfe, 0x00, 0x00, 0x1f, 0x00, 0x7f, 0xf7, 0xfe, 
0x00, 0x00, 0x3f, 0x00, 0x7f, 0xe7, 0xfe, 0x00, 0x00, 0x1f, 0x80, 0x3f, 0xe7, 0xfc, 0x00, 0x00, 
0x1f, 0x80, 0x3f, 0xe3, 0xfc, 0x00, 0x00, 0x1f, 0xc0, 0x3f, 0xc3, 0xfc, 0x00, 0x00, 0x1f, 0xe0, 
0x1f, 0x83, 0xf8, 0x00, 0x00, 0x0f, 0xf0, 0x1f, 0x81, 0xf8, 0x00, 0x00, 0x07, 0xf0, 0x3f, 0x01, 
0xf0, 0x00, 0x00, 0x03, 0xe0, 0x3e, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0xf8, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

};

static const uint8_t b_sucio [] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x07, 0xc7, 0xc0, 0x00, 0x00, 0x00, 0xf0, 0x18, 0x47, 0xf0, 0x1e, 0x00, 0x01, 0xf8, 0x7e, 
0x0f, 0xf8, 0x3f, 0x00, 0x03, 0x0c, 0xff, 0x3f, 0xfe, 0x61, 0x80, 0x06, 0x0d, 0xff, 0xff, 0xcf, 
0x60, 0xc0, 0x06, 0x07, 0xff, 0xff, 0xcf, 0xc0, 0xc0, 0x06, 0x07, 0xff, 0xff, 0xef, 0xc0, 0xc0, 
0x06, 0x07, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0x06, 0x07, 0xf3, 0xff, 0x8f, 0xc0, 0xc0, 0x06, 0x07, 
0xe0, 0xfe, 0x07, 0xc0, 0xc0, 0x06, 0x07, 0xc0, 0x7c, 0x03, 0xc0, 0xc0, 0x06, 0x07, 0x8c, 0x10, 
0x63, 0xc0, 0xc0, 0x06, 0x07, 0x8c, 0x00, 0x63, 0xe0, 0xc0, 0x03, 0x07, 0x9e, 0x00, 0xf3, 0xe1, 
0x80, 0x03, 0x0f, 0x9e, 0x00, 0xf3, 0xe1, 0x80, 0x03, 0x1f, 0xcc, 0x00, 0x67, 0xf1, 0x80, 0x01, 
0xff, 0xe0, 0x00, 0x0f, 0xff, 0x00, 0x00, 0xff, 0xf0, 0x00, 0x1f, 0xfe, 0x00, 0x00, 0x3f, 0xfc, 
0x00, 0x7f, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0x01, 0xff, 0xf0, 0x00, 0x00, 0x3f, 0xff, 0x81, 0xff, 
0xf0, 0x00, 0x00, 0x3f, 0x9f, 0x83, 0xff, 0xf0, 0x00, 0x00, 0x1f, 0x8f, 0xc3, 0xc1, 0xf0, 0x00, 
0x00, 0x1f, 0xef, 0xc7, 0xc1, 0xe0, 0x60, 0x00, 0x1f, 0xef, 0xff, 0xc1, 0xe1, 0xf0, 0x00, 0x0f, 
0xeb, 0xff, 0xf9, 0xc3, 0xf8, 0x00, 0x07, 0xe3, 0xff, 0xf9, 0xc7, 0xfc, 0x00, 0x07, 0xe3, 0xff, 
0xf3, 0x83, 0xfc, 0x00, 0x03, 0xf7, 0xff, 0xe3, 0x81, 0x3c, 0x00, 0x03, 0xff, 0xff, 0xe3, 0xc0, 
0x7c, 0x00, 0x01, 0xff, 0xff, 0xe7, 0xc0, 0x7c, 0x00, 0x01, 0xff, 0xff, 0xff, 0xf0, 0xfc, 0x00, 
0x00, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x7f, 
0xef, 0xfc, 0xff, 0xe0, 0x00, 0x00, 0x7e, 0xef, 0xfc, 0x3f, 0xc0, 0x00, 0x00, 0x38, 0xef, 0xf8, 
0x00, 0x00, 0x00, 0x00, 0x3f, 0xef, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xef, 0xf0, 0x00, 0x00, 
0x00, 0x00, 0x1f, 0xef, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xef, 0xe0, 0x00, 0x00, 0x00, 0x00, 
0x0f, 0xc7, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

};

static const uint8_t b_muerto [] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xc0, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 
0x00, 0x00, 0x00, 0xc0, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x90, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x99, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0xc0, 
0x18, 0x00, 0x07, 0x80, 0x00, 0x00, 0xc1, 0x18, 0x00, 0x07, 0x80, 0x00, 0x00, 0x73, 0x18, 0x1f, 
0xf0, 0x00, 0x00, 0x00, 0x30, 0x08, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x10, 0x29, 0xff, 0xc0, 0x00, 
0x00, 0x00, 0x18, 0x7b, 0xff, 0x00, 0x00, 0x00, 0x00, 0x19, 0x73, 0xfc, 0x00, 0x0f, 0x80, 0x00, 
0x0f, 0xe7, 0xf9, 0x0e, 0x0f, 0xe0, 0x00, 0x00, 0x0f, 0xf9, 0xdc, 0x1f, 0xe0, 0x00, 0x00, 0x0f, 
0xf0, 0x70, 0x1f, 0xf0, 0x00, 0x00, 0x1f, 0xe0, 0xf8, 0x1f, 0xf0, 0x00, 0x00, 0x1f, 0xf1, 0xce, 
0x1f, 0xf8, 0x00, 0x00, 0x1f, 0xf0, 0x80, 0x3f, 0xff, 0x0b, 0x00, 0x1f, 0xf8, 0x00, 0xff, 0xff, 
0xfb, 0x00, 0x3f, 0xfe, 0x03, 0xff, 0xff, 0xff, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x3f, 0xff, 
0xff, 0xff, 0xff, 0xff, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1f, 0xff, 0xff, 0xff, 
0xff, 0xff, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xf8, 
0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x0f, 
0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x0e, 0x0f, 0xff, 0xff, 0xe1, 0xf8, 0x00, 0x18, 0x00, 0xff, 
0xff, 0x87, 0xfc, 0x00, 0x18, 0x00, 0x7f, 0xff, 0x1f, 0xfe, 0x00, 0x3c, 0x00, 0x3f, 0xff, 0xff, 
0xfe, 0x00, 0x1c, 0x00, 0x3f, 0xff, 0xff, 0xfe, 0x00, 0x0e, 0x00, 0x3f, 0xff, 0xff, 0xbe, 0x00, 
0x0e, 0x00, 0x3f, 0xff, 0xfe, 0x3e, 0x00, 0x07, 0xa0, 0x7c, 0x0f, 0xfc, 0x7e, 0x00, 0x03, 0xff, 
0x78, 0x07, 0xe1, 0xfe, 0x00, 0x00, 0xff, 0xe0, 0x00, 0x07, 0xfe, 0x00, 0x00, 0x3f, 0xc0, 0x00, 
0x07, 0xfe, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x07, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

};

static const uint8_t b_comer [] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x1c, 0x70, 0x00, 0x60, 0x00, 0x00, 0x00, 0x18, 0x30, 0x01, 0xf0, 0x00, 0x00, 0x00, 
0x18, 0x30, 0x01, 0xf0, 0x00, 0x00, 0x00, 0x30, 0x38, 0x01, 0xf0, 0x00, 0x00, 0x00, 0x70, 0x18, 
0x01, 0xf8, 0x00, 0x00, 0x01, 0xf0, 0x3e, 0x01, 0xf8, 0x00, 0xc0, 0x03, 0xf8, 0x3f, 0x00, 0xf8, 
0x00, 0xe0, 0x03, 0xf8, 0x3f, 0x80, 0xf8, 0x03, 0xc0, 0x03, 0xfc, 0xff, 0xc0, 0xfc, 0x07, 0x80, 
0x01, 0xc7, 0xff, 0xc0, 0x7c, 0x0f, 0x80, 0x80, 0x03, 0xff, 0xe0, 0x7e, 0x1f, 0x81, 0xc0, 0x01, 
0xff, 0xe0, 0x3e, 0x1f, 0x00, 0xc0, 0x01, 0xff, 0xf0, 0x3e, 0x3f, 0x00, 0xc1, 0xf0, 0xff, 0xf0, 
0x7e, 0x3f, 0x00, 0x00, 0x18, 0xff, 0xf8, 0x7e, 0x3f, 0x00, 0x00, 0x0c, 0xff, 0xf8, 0x7e, 0x3f, 
0x00, 0x00, 0x01, 0xff, 0xf8, 0x7e, 0x3f, 0x80, 0x70, 0x03, 0xff, 0xf8, 0x7e, 0x3f, 0xc0, 0x1f, 
0x03, 0xff, 0xf8, 0x7e, 0x1f, 0xe0, 0x5f, 0x87, 0xff, 0xf8, 0xfe, 0x1f, 0xf0, 0x05, 0xff, 0xff, 
0xf8, 0xfe, 0x0f, 0xfc, 0x00, 0xff, 0xff, 0xff, 0xfc, 0x07, 0xff, 0x27, 0xff, 0xff, 0xff, 0xfc, 
0x07, 0xff, 0x2f, 0xff, 0xff, 0xff, 0xf8, 0x01, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 
0x3f, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x0f, 0xff, 
0xff, 0xfc, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0x00, 
0x00, 0x00, 0x00, 0x03, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xfc, 0x00, 0x00, 0x00, 
0x00, 0x00, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xf0, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf0, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x07, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf0, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x03, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 
0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

};

static const uint8_t b_duchar [] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x38, 0x00, 0x03, 0x60, 0x00, 
0x00, 0x00, 0x6c, 0x00, 0x02, 0x20, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x03, 0x60, 0x00, 0x00, 0x00, 
0x82, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x6c, 0x00, 
0x00, 0x07, 0xfc, 0x00, 0x00, 0x38, 0x00, 0xf0, 0x1f, 0xfc, 0x00, 0x1e, 0x00, 0x01, 0xf8, 0x7f, 
0xfc, 0x00, 0x3f, 0x00, 0x03, 0x0c, 0xff, 0xfe, 0x00, 0x61, 0x80, 0x06, 0x0d, 0xff, 0xff, 0x00, 
0x60, 0xc0, 0x06, 0x07, 0xff, 0xff, 0x81, 0xc0, 0xc0, 0x06, 0x07, 0xff, 0xff, 0xe7, 0xc0, 0xc0, 
0x06, 0x07, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0x06, 0x07, 0xf3, 0xff, 0x8f, 0xc0, 0xc0, 0x06, 0x07, 
0xe0, 0xfe, 0x07, 0xc0, 0xc0, 0x06, 0x07, 0xc0, 0x7c, 0x03, 0xc0, 0xc0, 0x06, 0x07, 0x8c, 0x10, 
0x63, 0xc0, 0xc0, 0x06, 0x07, 0x8c, 0x00, 0x63, 0xe0, 0xc0, 0x03, 0x07, 0x9e, 0x00, 0xf3, 0xe1, 
0x80, 0x03, 0x1f, 0x9e, 0x00, 0xf3, 0xe1, 0x80, 0x03, 0x7f, 0xcc, 0x00, 0x67, 0xf1, 0xb8, 0x01, 
0xc1, 0xe0, 0x00, 0x0f, 0xff, 0x6c, 0x01, 0x80, 0xf0, 0x00, 0x1f, 0xfe, 0xc6, 0x01, 0x00, 0x7c, 
0x00, 0x7f, 0xf8, 0x82, 0x01, 0x00, 0x7f, 0x01, 0xff, 0xf0, 0xc6, 0x00, 0x80, 0xff, 0x81, 0xff, 
0xf0, 0x6c, 0x00, 0xc1, 0xff, 0x83, 0xff, 0xf0, 0x38, 0x00, 0x77, 0xff, 0xc3, 0xff, 0xf0, 0x00, 
0x00, 0x1f, 0xff, 0xc7, 0xff, 0xe0, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x0f, 
0xfc, 0x7f, 0xff, 0xc0, 0x70, 0x00, 0x07, 0xf0, 0x1f, 0xff, 0xc1, 0xf8, 0x00, 0x07, 0xe0, 0x0f, 
0xff, 0x83, 0xfc, 0x00, 0x03, 0xc0, 0x07, 0xff, 0x81, 0xfe, 0x03, 0xc3, 0xc0, 0x07, 0xff, 0x81, 
0xff, 0x06, 0x61, 0xc0, 0x07, 0xff, 0xc0, 0x3e, 0x0c, 0x31, 0xe0, 0x0f, 0xff, 0xe0, 0x3e, 0x08, 
0x10, 0xf0, 0x1f, 0xff, 0xf0, 0x7e, 0x08, 0x10, 0xfc, 0x7f, 0xff, 0xff, 0xfe, 0x0c, 0x30, 0x7f, 
0xef, 0xfd, 0xff, 0xfc, 0x06, 0x60, 0x7f, 0xef, 0xfc, 0xff, 0xf0, 0x03, 0xc0, 0x3f, 0xef, 0xf8, 
0x3f, 0xe0, 0x00, 0x00, 0x3f, 0xef, 0xf8, 0x00, 0x80, 0x00, 0x00, 0x1f, 0xef, 0xf0, 0x00, 0x00, 
0x00, 0x00, 0x1f, 0xef, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xef, 0xe0, 0x00, 0x00, 0x00, 0x00, 
0x0f, 0xc7, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

};

static const uint8_t b_mimos [] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x10, 0x3f, 0x80, 0x00, 0x19, 
0xc0, 0x00, 0x7c, 0x7f, 0xc0, 0x00, 0x3f, 0xe0, 0x00, 0xcf, 0xff, 0xf0, 0x00, 0x3f, 0xe0, 0x00, 
0xe1, 0xdf, 0xf0, 0x00, 0x3f, 0xe0, 0x00, 0x78, 0x1f, 0xf0, 0x00, 0x3f, 0xc0, 0x00, 0xf0, 0x0f, 
0xe0, 0x00, 0x1f, 0xc0, 0x01, 0x84, 0x07, 0x80, 0x00, 0x07, 0x80, 0x07, 0x0c, 0x06, 0x00, 0x00, 
0x03, 0x00, 0x0e, 0x18, 0x8e, 0x00, 0x00, 0x01, 0x00, 0x1e, 0x73, 0x1f, 0x00, 0x00, 0x00, 0x00, 
0x3e, 0xe3, 0x1f, 0x80, 0x00, 0x00, 0x1c, 0x7f, 0xe3, 0x3f, 0xc2, 0x00, 0x00, 0x36, 0x7f, 0xff, 
0x7f, 0xc7, 0x00, 0x00, 0x23, 0xff, 0xff, 0xff, 0xe8, 0x80, 0x00, 0x21, 0xfe, 0xff, 0xe3, 0xf8, 
0x80, 0x00, 0x21, 0xf0, 0x3f, 0x81, 0xf0, 0x80, 0x00, 0x21, 0xe0, 0x1f, 0x00, 0xf0, 0x80, 0x00, 
0x21, 0xe0, 0x00, 0x00, 0x70, 0x80, 0x00, 0x21, 0xe1, 0x80, 0x18, 0x70, 0x80, 0x00, 0x21, 0xe2, 
0x40, 0x24, 0x70, 0x80, 0x00, 0x21, 0xe4, 0x20, 0x42, 0x70, 0x80, 0x00, 0x11, 0xe0, 0x00, 0x00, 
0x71, 0x00, 0x00, 0x11, 0xf0, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x11, 0xf0, 0x00, 0x01, 0xf1, 0x00, 
0x00, 0x0d, 0xf8, 0x00, 0x03, 0xf6, 0x00, 0x00, 0x0f, 0xfc, 0x0c, 0x0f, 0xfe, 0x00, 0x00, 0x07, 
0xfe, 0x0c, 0x1f, 0xfc, 0x00, 0x00, 0x01, 0xff, 0x80, 0x3f, 0xf0, 0x00, 0x00, 0x01, 0xff, 0xc0, 
0x7f, 0xf0, 0x00, 0x00, 0x00, 0xff, 0xe1, 0xff, 0xe1, 0xc0, 0x3e, 0x00, 0xff, 0xff, 0xff, 0xc3, 
0xd8, 0x3f, 0x01, 0xff, 0xff, 0xff, 0xc3, 0xfc, 0x3f, 0x83, 0xff, 0xff, 0xff, 0x83, 0xfc, 0x3f, 
0xcf, 0xff, 0xff, 0xff, 0x81, 0xfc, 0x1f, 0xef, 0xff, 0xff, 0xff, 0x81, 0xf8, 0x0f, 0xff, 0xff, 
0xff, 0xff, 0x80, 0xe0, 0x07, 0xff, 0xff, 0xff, 0xff, 0x80, 0x80, 0x03, 0xff, 0x3f, 0xff, 0xff, 
0x80, 0x00, 0x01, 0xfc, 0x3f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x40, 0x3f, 0xfb, 0xff, 0x80, 0x00, 
0x00, 0x00, 0x3f, 0xfb, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xfb, 0xff, 0x00, 0x00, 0x00, 0x00, 
0x0f, 0xf1, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe1, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 
0xfe, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x80, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 

};

static const uint8_t b_quieromimos [] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0xc7, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0xed, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xb8, 0x7c, 
0x00, 0x00, 0x00, 0x00, 0x0b, 0x38, 0x05, 0xe0, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0f, 0xc0, 0x00, 
0x00, 0x00, 0x08, 0x79, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x38, 0x7f, 0xe1, 0x80, 0x00, 0x00, 0x00, 
0xe0, 0xff, 0xf1, 0x80, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xf0, 0x80, 0x00, 0x00, 0x00, 0x60, 0xff, 
0xf0, 0xc0, 0x00, 0x00, 0x00, 0x20, 0x7f, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x20, 0x3f, 0xc1, 0x80, 
0x00, 0x00, 0x00, 0x60, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x60, 0x06, 0x01, 0x80, 0x00, 0x00, 
0x00, 0x38, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x06, 
0xf9, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x07, 0xff, 0xe7, 0x80, 0x00, 0x00, 0x00, 0x06, 0x07, 0xc0, 
0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xf0, 
0x00, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x36, 0x7f, 0xff, 0x00, 0x00, 
0x00, 0x00, 0x7a, 0x1f, 0xff, 0x80, 0x00, 0x00, 0x00, 0xfb, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x10, 
0xfb, 0x3f, 0xff, 0xc0, 0x00, 0x00, 0x39, 0xe6, 0xff, 0xff, 0xe6, 0x00, 0x00, 0x65, 0xfd, 0xff, 
0xff, 0xef, 0x00, 0x00, 0xe7, 0xfd, 0xff, 0xff, 0xff, 0x00, 0x00, 0xc3, 0xff, 0xff, 0xff, 0xf9, 
0x80, 0x00, 0xc3, 0xff, 0xff, 0xff, 0xf1, 0x80, 0x00, 0xc3, 0xf0, 0xff, 0x8f, 0xf1, 0xc0, 0x00, 
0xc3, 0xe0, 0x3e, 0x07, 0xf1, 0xc0, 0x00, 0xe3, 0xe0, 0x00, 0x11, 0xf1, 0x80, 0x00, 0x67, 0xec, 
0x00, 0x39, 0xfb, 0x80, 0x00, 0x3f, 0xe7, 0x80, 0x71, 0xff, 0x80, 0x00, 0x1d, 0xe3, 0xc1, 0xf1, 
0xde, 0x00, 0x00, 0x00, 0xf3, 0xc1, 0xe3, 0xc0, 0x00, 0x00, 0x00, 0xf1, 0xc1, 0x87, 0xc0, 0x00, 
0x00, 0x00, 0xf8, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x1f, 0xc0, 0x00, 0x00, 0x00, 
0x7e, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x7f, 0x9c, 0xff, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xc0, 
0xff, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x80, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x7f, 0x00, 
0x00, 0x00, 0x00, 0x1f, 0x00, 0x7e, 0x00, 0x00

};
static const uint8_t b_juego [] PROGMEM= {
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xc0, 
0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x00, 0x00, 
0x00, 0x01, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x03, 
0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x07, 0xfb, 0xf0, 0x0c, 0x00, 0x00, 0x00, 0x07, 0xf1, 0xf0, 
0x0e, 0x00, 0x00, 0x00, 0x07, 0xe0, 0xe0, 0x06, 0x00, 0x00, 0x00, 0x0f, 0xe0, 0xe0, 0x63, 0x00, 
0x00, 0x1e, 0x0f, 0xe0, 0x60, 0xf0, 0x00, 0x00, 0x3f, 0x0f, 0xe0, 0x60, 0xf0, 0x00, 0x00, 0x3f, 
0x1f, 0xe0, 0x70, 0xf0, 0x00, 0x00, 0x3f, 0x1f, 0xe0, 0x70, 0x60, 0x00, 0x00, 0x3f, 0x1f, 0xf0, 
0x70, 0x00, 0xc0, 0x00, 0x1f, 0x9f, 0xf0, 0xf8, 0x00, 0xc0, 0x00, 0x0f, 0x9f, 0xfd, 0xfc, 0x00, 
0xc0, 0x00, 0x0f, 0x9f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x0f, 0x9f, 0xff, 0xff, 0xf0, 0x00, 0x00, 
0x0f, 0x9f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x0f, 0x9f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x1f, 0x9f, 
0xff, 0xff, 0xfc, 0x00, 0x00, 0x1f, 0x0f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x1f, 0x0f, 0xff, 0xff, 
0xff, 0x00, 0x00, 0x1f, 0x0f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1f, 0x0f, 0xff, 0xff, 0xfe, 0x00, 
0x00, 0x1f, 0x0f, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x1f, 0xbf, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x1f, 
0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x0f, 0xff, 0xff, 
0xff, 0xf0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xfc, 0xff, 0xff, 0xc0, 
0x00, 0x00, 0x01, 0xf8, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xc0, 0x00, 0x00, 
0x00, 0x00, 0x3f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 
0x1f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xf0, 0x00, 
0x00, 0x00, 0x00, 0x03, 0xff, 0xf0, 0x00, 0x00 
  
  };
static const uint8_t b_dormir [] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 
0x00, 0x00, 0x00, 0xe3, 0xf9, 0xf8, 0x00, 0x00, 0x00, 0x0f, 0xc7, 0xb9, 0x18, 0x00, 0x00, 0x00, 
0x7f, 0xc0, 0x30, 0x30, 0x00, 0x00, 0x00, 0x31, 0xc0, 0x70, 0x30, 0x00, 0x00, 0x00, 0x01, 0x80, 
0x60, 0x20, 0x00, 0x00, 0x00, 0x01, 0x80, 0x60, 0x7e, 0x00, 0x00, 0x00, 0x03, 0x80, 0xe2, 0x70, 
0x00, 0x00, 0x00, 0x03, 0x80, 0xff, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0xf8, 0x00, 0x00, 0x00, 
0x00, 0x07, 0x78, 0x80, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 
0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x0f, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xfc, 0x00, 0x00, 0x00, 
0x00, 0x7f, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, 0xff, 
0xff, 0xff, 0x80, 0x00, 0x01, 0xf3, 0xff, 0xff, 0xff, 0xdf, 0x00, 0x03, 0x9f, 0xff, 0xff, 0xff, 
0xff, 0x80, 0x03, 0x1f, 0xff, 0xff, 0xff, 0xf1, 0x80, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xf1, 0x80, 
0x02, 0x0f, 0xff, 0xff, 0xff, 0xf0, 0x80, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xf0, 0x80, 0x02, 0x0f, 
0xff, 0xff, 0xff, 0xf0, 0x80, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xf0, 0xc0, 0x02, 0x0f, 0xff, 0xff, 
0xff, 0xf0, 0x80, 0x03, 0x0f, 0xff, 0xff, 0xff, 0xf9, 0x80, 0x03, 0x9f, 0xff, 0xff, 0xff, 0xf9, 
0x80, 0x01, 0xdf, 0xff, 0xff, 0xff, 0xfb, 0x80, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 
0x0f, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x03, 0xff, 
0xff, 0xff, 0xc0, 0x40, 0x00, 0x01, 0xff, 0xff, 0xff, 0xc3, 0xfc, 0x00, 0x00, 0xff, 0xff, 0xff, 
0xef, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 
0x00, 0x00, 0x0f, 0xff, 0xbf, 0xff, 0xff, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0xfe, 0xfe, 0x00, 0x00, 
0x00, 0x00, 0x0f, 0xfc, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

};

//Iconos de contadores
static const uint8_t cont_icon_hambre[]PROGMEM = {0x03, 0x00, 0x07, 0x00, 0x04, 0x00, 0x3b, 0x80, 0x7f, 0xc0, 0x7f, 0xc0, 0x7f, 0xc0, 0x7f, 0xc0, 
0x7f, 0xc0, 0x3f, 0x80, 0x0e, 0x00
};

static const uint8_t cont_icon_suenho[]PROGMEM = {0x07, 0x80, 0x0f, 0x00, 0x1e, 0x00, 0x3c, 0x00, 0x34, 0x00, 0x7e, 0x00, 0x3c, 0x00, 0x3c, 0x00, 
0x1e, 0x00, 0x0e, 0x00, 0x07, 0x80
};

static const uint8_t cont_icon_sucio[]PROGMEM = {0xc4, 0x00, 0xfc, 0x00, 0x78, 0x00, 0x7a, 0x00, 0x70, 0x00, 0xc2, 0x80, 0x10, 0x00, 0x04, 0x00, 
0x00, 0x80, 0x15, 0x00, 0x00, 0x00
};

static const uint8_t cont_icon_mimos[]PROGMEM = {0x00, 0x00, 0x00, 0x00, 0x31, 0x80, 0x7b, 0xc0, 0x7f, 0xc0, 0x3f, 0x80, 0x3f, 0x80, 0x1f, 0x00, 
0x0e, 0x00, 0x04, 0x00, 0x00, 0x00
};

//Música
const float comiendo[] = {RE,LA,SILENCE,RE,LA,SILENCE,RE,LA};
const float delcomiendo[] = {c,c,c,c,c,c,c,c};
const float ducha[] = {SI,FA,SI,RE,DO,FA,LA,DO,SI};
const float delducha[] = {c,c,c,c,c,c,c,c,c};
const float duerme[] = {DO,RE,SI,LA,SOL,SILENCE,DO,RE,SOL,FAS,SILENCE,DO,RE,DO,SI,LA,SILENCE,LA,SOL,MI,RE};
const float delduerme[] = {n,n,c,c,c,c,n,n,c,c,c,n,n,c,c,c,c,c,c,c,c};
const float dandomimos[] = {SOL,SILENCE,SOL,DO2,SI,LA,SI,SILENCE,SOL,SILENCE,SOL,DO2,SI,LA,SI};
const float delmimos[] = {s,s,s,c,c,c,c,c,s,s,s,c,c,c,c};
const float juguemos[] = {RE,SOL,RE,SOL,RE,SOL,RE,SILENCE,RE,RE,DO,RE,DO,SIG,LAG};
const float deljuguemos[] = {c,c,c,c,c,c,n,s,c,c,c,c,c,c,n,n};
const float requiem[]={LA, MI ,DO ,LAG};
const float delrequiem[]={c,c,c,c};

//////////////
//Pines
//////////////

//Menú
int estado_actual = 0;
int cont = 0;

//Timbre
#define sonido 4

//Botones
#define menu 7
#define cancelar 5
#define aceptar 2
int menu_p, cancelar_p, aceptar_p;

//Sensor
#define Trigger 6          
#define Echo 3           

//Variables jugar
int x0, y0;
int w, h;
long t;                               //Tiempo que demora en llegar el eco
long d;                               //Distancia en centimetros
int puntuacion;
int i;

//Juego
void JUGAR(){
  int contj;
  tft.fillScreen(ILI9341_WHITE);
  tft.setTextSize(5);
  tft.setTextColor(ILI9341_GREEN);
  tft.setCursor(60,100);
  tft.print("JUGAR");
  tft.setTextSize(2);
  tft.setTextColor(ILI9341_BLACK);
  tft.setCursor(10,150);
  tft.print("Usa tu mano para saltar");
  tft.setCursor(10,170);
  tft.print("El sensor derecho detecta tu movimiento");
  cantar(juguemos, deljuguemos, 15);
  delay(2000);
  puntuacion = 0;
  while(cancelar_p == LOW){
    
    x0 = 300;
    y0 =random(80)+120;
    w = 20;
    h = 20;
    i=0;
    
    while(i<15 && cancelar_p==LOW){
      x0=x0-20;
      tft.fillScreen(ILI9341_WHITE);
      digitalWrite(Trigger, HIGH);
      delayMicroseconds(10);                    //Enviamos un pulso de 10us
      digitalWrite(Trigger, LOW);
  
       t = pulseIn(Echo, HIGH);                  //Obtenemos el ancho del pulso
       d = t/59;    
       Serial.print("\n");
       Serial.print(d);
       tft.fillScreen(ILI9341_WHITE);
       tft.drawRect(x0, y0, w, h, ILI9341_RED);
       tft.fillRect(x0, y0, w, h, ILI9341_RED);
      if(d <= 30 && d>7){
        //Saltar babuino
        tft.drawBitmap(80,50,b_juego,56,56,BLACK);
        if(x0==80){
          puntuacion++;
          lcd.clear();
          lcd.setCursor(1,0);
          lcd.print("PUNTUACION");
          lcd.setCursor (1,1);
          lcd.print(puntuacion);
        }
        //guardar posición 
      }else{
        tft.drawBitmap(80,150,b_juego,56,56,BLACK);
        if(x0==80){
        tft.fillScreen(ILI9341_WHITE);
        tft.setTextSize(5);
        tft.setTextColor(ILI9341_RED);
        tft.setCursor(30,100);
        
        tft.print("GAME OVER");
        cantar(requiem,delrequiem,4);
        delay(1000);
        return;
        }
      }
      i++;
      cancelar_p = digitalRead(cancelar);
    }
    
    cancelar_p = digitalRead(cancelar);
    if(cancelar_p==HIGH){
      tone(sonido,DO);
      delay(100);
      noTone(sonido);
    }
                                //Escalamos el tiempo a una distancia en cm
    
    //Dibujar babuino
    //Dejamos que pueda reaccionar en 3 segundos
    
                                          //if de si el arduino está tocando con el obstáculo, se sale
  }
}

void cantar(float can[], float del[], int si){
  for(int i = 0;i < si;i++){
    tone(sonido,round(can[i]));
    delay(del[i]);
  }
  noTone(sonido);
}

//Controla las variables en el terminal
void control_var(){
  Serial.print(cont_hambre);
  Serial.print("     ");
  Serial.print(cont_suciedad);
  Serial.print("     ");
  Serial.print(cont_mimos);
  Serial.print("     ");
  Serial.println(cont_suenho);
}

//Muestra la opción del menú seleccionada
void fMenu(int est){

  tft.fillScreen(ILI9341_WHITE);
  tft.drawBitmap(194,30,icon_duchar,56,56,GREY);
  tft.drawBitmap(194,86,icon_mimos,56,56,GREY);
  tft.drawBitmap(194,142,icon_apagar,56,56,GREY);
  tft.drawBitmap(66,86,icon_dormir,56,56,GREY);
  tft.drawBitmap(66,30,icon_comida,56,56,GREY);
  tft.drawBitmap(66,142,icon_jugar,56,56,GREY);

 //Mostrar Menu Correspondiente
  switch (est){
    
    case 0:
      lcd.clear();
      lcd.setCursor(1,0);
      lcd.print("MENU");
      lcd.setCursor (1,1);
      lcd.print("APAGAR      ");
      tft.drawBitmap(194,142,icon_apagar,56,56,BLACK);
      break;
    
    case 1:
      lcd.clear();
      lcd.setCursor(1,0);
      lcd.print("MENU");
      lcd.setCursor (1,1);
      lcd.print("DAR DE COMER      ");
      tft.drawBitmap(66,30,icon_comida,56,56,BLACK);
      break;
    
    case 2:
     lcd.clear();
     lcd.setCursor(1,0);
     lcd.print("MENU");
     lcd.setCursor (1,1);
     lcd.print("DUCHAR      ");
     tft.drawBitmap(194,30,icon_duchar,56,56,BLACK);
     break;
    
    case 3:
     lcd.clear();
     lcd.setCursor(1,0);
     lcd.print("MENU");
     lcd.setCursor (1,1);
     lcd.print("ACOSTAR      "); 
     tft.drawBitmap(66,86,icon_dormir,56,56,BLACK);
     break;
     
    case 4:
     lcd.clear();
     lcd.setCursor(1,0);
     lcd.print("MENU");
     lcd.setCursor (1,1);
     lcd.print("DAR MIMOS      ");
     tft.drawBitmap(194,86,icon_mimos,56,56,BLACK);
     break;
    
    case 5:
     lcd.clear();
     lcd.setCursor(1,0);
     lcd.print("MENU");
     lcd.setCursor (1,1);
     lcd.print("JUGAR      ");
     tft.drawBitmap(66,142,icon_jugar,56,56,BLACK);
     break;  
  }
}

//Mostrar los sprites de acciones
void cuidado(int est){
  switch (est){

    case 0: 
      tft.fillScreen(ILI9341_BLACK);		//Apagar

      while(1){
        tft.setTextSize(4);
        tft.setTextColor(ILI9341_RED);
        tft.setCursor(30,100);
        tft.print("APAGA LA ");
        tft.setCursor(30,200);
        tft.print("ALIMENTACION ");
       	lcd.noBacklight();
      }
      break;
    
    case 1:
      cont_hambre = total;
      in_men_hambre = false;
      tft.fillScreen(ILI9341_WHITE);
      tft.drawBitmap(x,y,b_comer,56,56,0);
      cantar(comiendo,delcomiendo,8);

      break;
    
    case 2:
      cont_suciedad = total;
      in_men_suciedad = false;
      tft.fillScreen(ILI9341_WHITE);
      tft.drawBitmap(x,y,b_duchar,56,56,0);
      cantar(ducha,delducha,9);
    
      break;
    
    case 3:
      cont_suenho = total;
      in_men_suenho = false;
      tft.fillScreen(ILI9341_WHITE);
      tft.drawBitmap(x,y,b_dormir,56,56,0);
      cantar(duerme,delduerme,21);
     
      break;
    
    case 4:
      cont_mimos = total;
      in_men_mimos = false;
      tft.fillScreen(ILI9341_WHITE);
      tft.drawBitmap(x,y,b_mimos,56,56,0);
      cantar(dandomimos,delmimos,15);

      break;
    
    case 5:
      JUGAR();
      break; 
  }
}

//Mostrar mensaje en pantalla pequeña
void mensaje_arriba(String mensaje){

  lcd.backlight();
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print(mensaje);
  
  for(int i = 0; i < 2;i++){
      lcd.display();
      delay(500);
      lcd.noDisplay();
      delay(500);
  }
  lcd.display();
}

void setup() {
    Serial.begin(9600);			//inicializamos la comunicación
    pinMode(Trigger, OUTPUT); 		//pin como salida
    pinMode(Echo, INPUT);  		//pin como entrada
    digitalWrite(Trigger, LOW);		//Inicializamos el pin con 0
    Serial.begin(9600);

    //Configuración Botones
    pinMode(menu, INPUT);
    pinMode(cancelar, INPUT);
    pinMode(aceptar, INPUT);
    
    //Configuración Pantalla Arriba
    lcd.init();
    lcd.backlight();
    lcd.clear();
    
    //Configuración Pantalla Abajo
    tft.begin();
    uint8_t x = tft.readcommand8(ILI9341_RDMODE);
    Serial.print("Display Power Mode: 0x"); Serial.println(x, HEX);
    x = tft.readcommand8(ILI9341_RDMADCTL);
    Serial.print("MADCTL Mode: 0x"); Serial.println(x, HEX);
    x = tft.readcommand8(ILI9341_RDPIXFMT);
    Serial.print("Pixel Format: 0x"); Serial.println(x, HEX);
    x = tft.readcommand8(ILI9341_RDIMGFMT);
    Serial.print("Image Format: 0x"); Serial.println(x, HEX);
    x = tft.readcommand8(ILI9341_RDSELFDIAG);
    Serial.print("Self Diagnostic: 0x"); Serial.println(x, HEX); 
    tft.setRotation(3);
}

void loop() {

  //Control variables
  x = random(250);
  y = random(200);
  
  if(x < 50 && y < 70){
    x = x + 50;
    y = y + 70;
  }
  control_var();
  
  //Asignación de Botones
  menu_p = digitalRead(menu);
  cancelar_p = digitalRead(cancelar);
  aceptar_p = digitalRead(aceptar);

  //Controles de Botones
  if(menu_p == HIGH){
    tone(sonido,round(MI));
    delay(200);
    noTone(sonido);
    estado_actual = (cont % 6)+ 1;
    cont++;
    fMenu((cont % 6));  
  }
  
  if((cancelar_p == HIGH)&&(!estado_actual == 0)){
    tone(sonido,round(RE));
    delay(200);
    noTone(sonido);
    estado_actual = 0;
    cont = 0;
    lcd.clear();
  }
  
  if((aceptar_p == HIGH)&&(!estado_actual == 0)){
    tone(sonido,round(SI));
    delay(200);
    noTone(sonido);
    cuidado((cont % 6));    
    estado_actual = 0;
    cont = 0;
  }
  
  if(estado_actual == 0){
    cont_hambre = cont_hambre - 0.04;
    cont_suciedad = cont_suciedad - 0.01;
    cont_mimos = cont_mimos - 0.005;
    cont_suenho = cont_suenho - 0.001;
    
    lcd.clear();
    
    if((cont_hambre <= umbral)){
  
      tft.fillScreen(ILI9341_WHITE);
      tft.drawBitmap(x,y,b_hambre,56,56,0);
        
        if(!in_men_hambre){
            mensaje_arriba("TENGO HAMBRE  ");
            in_men_hambre = true;
        } 
        delay(1000);
    }
    
    if((cont_suciedad <= umbral)){
      tft.fillScreen(ILI9341_WHITE);
      tft.drawBitmap(x,y,b_sucio,56,56,0);
     
        if(!in_men_suciedad){
            mensaje_arriba("TENGO MUGRE  ");
            in_men_suciedad = true;
        }
        delay(1000);
    }
    
    if((cont_mimos <= umbral)){
      tft.fillScreen(ILI9341_WHITE);
      tft.drawBitmap(x,y,b_quieromimos,56,56,0);
     
        if(!in_men_mimos){
            mensaje_arriba("QUIERO MIMOS  ");
            in_men_mimos = true;
        }
        delay(1000);
    }
    
    if((cont_suenho <= umbral)){
      
      tft.fillScreen(ILI9341_WHITE);
      tft.drawBitmap(x,y,b_suenho,56,56,0);
    
        if(!in_men_suenho){
            mensaje_arriba("TENGO SUENO  ");
            in_men_suenho = true;
        } 
        delay(1000);
    }
    
    if((cont_hambre <= 0)||(cont_suciedad <= 0)||(cont_mimos <= 0)||(cont_suenho <= 0)){
      tft.fillScreen(ILI9341_WHITE);
      tft.drawBitmap(x,y,b_muerto,56,56,0);

      while(1){
          mensaje_arriba("HE MUERTO :'(  ");
          menu_p = digitalRead(menu);
          aceptar_p = digitalRead(aceptar);
          if(aceptar_p == HIGH && menu_p == HIGH){
            mensaje_arriba("HE REVIVIDO :)");
            cont_hambre = total/2;
            cont_suciedad = total/2;
            cont_suenho = total/2;
            cont_mimos = total/2;
            break;
          }
      }
    }
    else{
      //Imprime bitmap
      tft.fillScreen(ILI9341_WHITE);
      tft.drawBitmap(x,y,b_normal,56,56,0);
      
      //Imprime contadores
      tft.setCursor(0,0);
      tft.setTextColor(0x0000);
      tft.setTextSize(1);
      tft.setTextWrap(true);
      
      //tft.print("Hambre:");
   
      tft.drawBitmap(5,5,cont_icon_hambre,11,11,0);
      tft.setCursor(20,5);
      tft.print(cont_hambre/total*100);
    
      //tft.print("Suciedad:");
      
      tft.drawBitmap(5,25,cont_icon_sucio,11,11,0);
      tft.setCursor(20,25);
      tft.print(cont_suciedad/total*100);

      //tft.print("Mimos:");
      
      tft.drawBitmap(5,45,cont_icon_mimos,11,11,0);    
      tft.setCursor(20,45);
      tft.print(cont_mimos/total*100);
      
      //tft.print("Sueno:");
       
      tft.drawBitmap(5,65,cont_icon_suenho,11,11,0);         
      tft.setCursor(20,65);
      tft.print(cont_suenho/total*100);
      
      delay(1000);
    }
  }
}

FUNCIONALIDAD

Babuino tiene 4 características principales: hambre, suciedad, sueño y cariño. Todas se muestra en la pantalla mediante un porcentaje y unos iconos. Si una de estas llega a 0, Babuino muere. Para evitar esto, se debe ir a la sección adecuada para rellenar la característica. Cuando está a punto de acabarse, Babuino imprime un aviso en la pantalla superior y empieza a cambiar su sprite.

Para llegar a esta secciones, hay un Menú que se puede navegar. Este tiene 6 opciones: Comer, Ducharse, Dormir, Dar Mimos, Jugar y Apagar. Cada uno de estos, rellena una característica de Babuino. La sección Jugar consiste en un videojuego, donde Babuino tendrá que saltar obstáculos dirigido por el movimiento de la mano del jugador. La sección Apagar deja la pantalla en blanco, impidiendo volver a usarlo hasta que se vuelve a encender. El resto de secciones muestran el sprite de la acción y vuelven a la pantalla principal.

PROTOTIPO FINAL (HARDWARE)

CONEXIONES

PINES ANALÓGICOS

LCD: Pines A4 y A5

PINES DIGITALES

Pantalla: Pines 13 (SCK), 12 (MISO), 11 (MOSI). Todos estos componen el bus SPI. También se usan los pines 10 (CS), 9 (RST) y 8 (DC).

Botones: Pines 7 (Menú), 5 (Cancelar) y 2 (Aceptar)

Altavoz: Pin 4

Sensor: Pin 6 (Trig) y 3 (Echo)

FUNCIONALIDAD DE LOS COMPONENTES

La pantalla de arriba nos muestra nuestra situación en el juego y nos manda notificaciones

La pantalla de abajo nos muestra el juego.

Los 3 botones (Menu, Cancelar, Aceptar, de izquierda a derecha) sirven para controlar el juego.

El sensor (situado a la derecha de la caja) sirve para jugar al juego con Babuino.

El altavoz (parte inferior) emite los sonidos del juego.

El interruptor (parte superior) enciende y apaga la alimentación.

VÍDEO DEMOSTRATIVO

REFERENCIAS

También te podría gustar...

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *