#include "U8glib.h"
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_DEV_0 | U8G_I2C_OPT_NO_ACK | U8G_I2C_OPT_FAST); // Fast I2C / TWI
// ' icon_agregar', 16x16px
const unsigned char epd_bitmap__icon_agregar [] PROGMEM = {
0x00, 0x00, 0x00, 0x04, 0x0e, 0x0e, 0x11, 0x04, 0x20, 0x80, 0x20, 0x40, 0x20, 0x20, 0x10, 0x70,
0x08, 0xf8, 0x05, 0xfc, 0x03, 0x7c, 0x01, 0x9c, 0x00, 0xf8, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00
};
// ' icon_eliminar', 16x16px
const unsigned char epd_bitmap__icon_eliminar [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x0e, 0x0e, 0x11, 0x00, 0x20, 0x80, 0x20, 0x40, 0x20, 0x20, 0x10, 0x70,
0x08, 0xf8, 0x05, 0xfc, 0x03, 0x7c, 0x01, 0x9c, 0x00, 0xf8, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00
};
// ' icon_horario', 16x16px
const unsigned char epd_bitmap__icon_horario [] PROGMEM = {
0x00, 0x00, 0x01, 0x80, 0x0f, 0xf0, 0x31, 0x8c, 0x28, 0x14, 0x41, 0x02, 0x51, 0x0a, 0x41, 0x02,
0x61, 0x06, 0x41, 0xe2, 0x50, 0x0a, 0x40, 0x02, 0x28, 0x14, 0x31, 0x8c, 0x0f, 0xf0, 0x08, 0x10
};
// Array of all bitmaps for convenience. (Total bytes used to store images in PROGMEM = 144)
const unsigned char* bitmap_iconos[3] = {
epd_bitmap__icon_agregar,
epd_bitmap__icon_eliminar,
epd_bitmap__icon_horario
};
// ' parte_seleccionada', 128x21px
const unsigned char epd_bitmap__parte_seleccionada [] PROGMEM = {
0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8
};
// ' scroll_background', 8x64px
const unsigned char epd_bitmap__scroll_background [] PROGMEM = {
0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40,
0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40,
0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40,
0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x00
};
/* -----------------------------Final de imágenes MENÚ PRINCIPAL ------------------------------*/
// ' ICON_DOMINGO', 16x16px
const unsigned char epd_bitmap__ICON_DOMINGO [] PROGMEM = {
0x00, 0x00, 0x1c, 0x38, 0x37, 0xec, 0x7f, 0xfe, 0x40, 0x02, 0x5c, 0x62, 0x52, 0x92, 0x52, 0x92,
0x52, 0x92, 0x52, 0x92, 0x52, 0x92, 0x5c, 0x6e, 0x40, 0x12, 0x40, 0x14, 0x3f, 0xf8, 0x00, 0x00
};
// ' ICON_JUEVES', 16x16px
const unsigned char epd_bitmap__ICON_JUEVES [] PROGMEM = {
0x00, 0x00, 0x1c, 0x38, 0x37, 0xec, 0x7f, 0xfe, 0x40, 0x02, 0x42, 0xa2, 0x42, 0xa2, 0x42, 0xa2,
0x42, 0xa2, 0x52, 0xa2, 0x4c, 0x42, 0x40, 0x0e, 0x40, 0x12, 0x40, 0x14, 0x3f, 0xf8, 0x00, 0x00
};
// ' ICON_LUNES', 16x16px
const unsigned char epd_bitmap__ICON_LUNES [] PROGMEM = {
0x00, 0x00, 0x1c, 0x38, 0x37, 0xec, 0x7f, 0xfe, 0x40, 0x02, 0x48, 0xa2, 0x48, 0xa2, 0x48, 0xa2,
0x48, 0xa2, 0x48, 0xa2, 0x4e, 0x42, 0x40, 0x0e, 0x40, 0x12, 0x40, 0x14, 0x3f, 0xf8, 0x00, 0x00
};
// ' ICON_MARTES', 16x16px
const unsigned char epd_bitmap__ICON_MARTES [] PROGMEM = {
0x00, 0x00, 0x1c, 0x38, 0x37, 0xec, 0x7f, 0xfe, 0x40, 0x02, 0x51, 0x32, 0x5b, 0x4a, 0x55, 0x4a,
0x51, 0x7a, 0x51, 0x4a, 0x51, 0x4a, 0x40, 0x0e, 0x40, 0x12, 0x40, 0x14, 0x3f, 0xf8, 0x00, 0x00
};
// ' ICON_MIERCOLES', 16x16px
const unsigned char epd_bitmap__ICON_MIERCOLES [] PROGMEM = {
0x00, 0x00, 0x1c, 0x38, 0x37, 0xec, 0x7f, 0xfe, 0x40, 0x02, 0x51, 0x72, 0x5b, 0x22, 0x55, 0x22,
0x51, 0x22, 0x51, 0x22, 0x51, 0x72, 0x40, 0x0e, 0x40, 0x12, 0x40, 0x14, 0x3f, 0xf8, 0x00, 0x00
};
// ' ICON_SABADO', 16x16px
const unsigned char epd_bitmap__ICON_SABADO [] PROGMEM = {
0x00, 0x00, 0x1c, 0x38, 0x37, 0xec, 0x7f, 0xfe, 0x40, 0x02, 0x4c, 0x62, 0x4a, 0x92, 0x48, 0x92,
0x44, 0xf2, 0x42, 0x92, 0x4a, 0x92, 0x44, 0x0e, 0x40, 0x12, 0x40, 0x14, 0x3f, 0xf8, 0x00, 0x00
};
// ' ICON_VIERNES', 16x16px
const unsigned char epd_bitmap__ICON_VIERNES [] PROGMEM = {
0x00, 0x00, 0x1c, 0x38, 0x37, 0xec, 0x7f, 0xfe, 0x40, 0x02, 0x51, 0x72, 0x51, 0x22, 0x51, 0x22,
0x51, 0x22, 0x4a, 0x22, 0x44, 0x72, 0x40, 0x0e, 0x40, 0x12, 0x40, 0x14, 0x3f, 0xf8, 0x00, 0x00
};
// Array of all bitmaps for convenience. (Total bytes used to store images in PROGMEM = 336)
const unsigned char* bitmap_iconos_dias[7] = {
epd_bitmap__ICON_DOMINGO,
epd_bitmap__ICON_JUEVES,
epd_bitmap__ICON_LUNES,
epd_bitmap__ICON_MARTES,
epd_bitmap__ICON_MIERCOLES,
epd_bitmap__ICON_SABADO,
epd_bitmap__ICON_VIERNES
};
// ' ICON_DOS_PUNTOS', 16x16px
const unsigned char epd_bitmap__ICON_DOS_PUNTOS [] PROGMEM = {
0x00, 0x00, 0x03, 0x80, 0x07, 0xc0, 0x0f, 0xe0, 0x0f, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x00, 0x00,
0x00, 0x00, 0x03, 0x80, 0x07, 0xc0, 0x0f, 0xe0, 0x0f, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x00, 0x00
};
// ' ICON_MARCO', 128x64px
const unsigned char epd_bitmap__ICON_MARCO [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0,
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// ' ICON_SELECCION_DIAS', 24x18px
const unsigned char epd_bitmap__ICON_SELECCION_DIAS [] PROGMEM = {
0x1f, 0xff, 0xc0, 0x20, 0x00, 0x60, 0x40, 0x00, 0x30, 0x40, 0x00, 0x30, 0x40, 0x00, 0x30, 0x40,
0x00, 0x30, 0x40, 0x00, 0x30, 0x40, 0x00, 0x30, 0x40, 0x00, 0x30, 0x40, 0x00, 0x30, 0x40, 0x00,
0x30, 0x40, 0x00, 0x30, 0x40, 0x00, 0x30, 0x40, 0x00, 0x30, 0x40, 0x00, 0x30, 0x40, 0x00, 0x30,
0x20, 0x00, 0x60, 0x1f, 0xff, 0xc0
};
/* -----------------------------Final de imágenes SUBMENÚ AGREGAR PASTILLAS ------------------------------*/
#define BOTON_SELECCION 2 //Definiendo el pin donde esta el boton 1, el que selecciona
#define BOTON_ABAJO 3 //Definiendo el pin donde esta el boton 2, el que va hacía abajo
#define BOTON_ARRIBA 4 //Definiendo el pin donde esta el boton 3, el que va hacía arriba
//Para el menu principal
const int numero_de_items = 3;
char items_de_menu[numero_de_items][20]{
{"Agregar"},
{"Eliminar"},
{"Ver horario"}
};
//Para el submenu 1 de agregar pastilla
const int numero_items_submenu1 = 4;
char items_de_submenu1[numero_items_submenu1][20]{
{"Cuando?"},
{"1"},
{"30"},
{"PM"}
};
int opcion_seleccionada = 0; //Una variable que sirve para tener control de que opción esta seleccionada.
int opcion_anterior; //Una variable para tener control de la opción anterior a la seleccionada.
int opcion_siguiente; //Una variable para tener control de la opción siguiente a la seleccionada.
int ABAJO_APRETADO = 0;
int ARRIBA_APRETADO = 0;
int SELECCIONADOR_APRETADO = 0;
int pantalla_actual = 0;
int dias = 18;
char formato1[] = "hh:mm ap";
void setup() {
Serial.begin(9600);
pinMode(BOTON_SELECCION, INPUT_PULLUP);
pinMode(BOTON_ABAJO, INPUT_PULLUP);
pinMode(BOTON_ARRIBA, INPUT_PULLUP);
u8g.setFont(u8g_font_tpssb);
u8g.setColorIndex(1);
}
void botonessub1(int botonarriba, int botonabajo) {
if ((digitalRead(botonarriba) == LOW) && (ARRIBA_APRETADO == 0)) {
dias = dias + 18;
ARRIBA_APRETADO = 1;
if(dias > 112) {
dias = 23;
}
}
else if ((digitalRead(botonabajo) == LOW) && (ABAJO_APRETADO == 0)) {
dias = dias - 20;
ABAJO_APRETADO = 1;
if(dias <= 107 ) {
dias = 112;
}
}
if ((digitalRead(botonarriba) == HIGH) && (ARRIBA_APRETADO == 1)) { // unclick
ARRIBA_APRETADO = 0;
}
if ((digitalRead(botonabajo) == HIGH) && (ABAJO_APRETADO == 1)) { // unclick
ABAJO_APRETADO = 0;
}
}
void loop() {
if(pantalla_actual == 0) {
//DateTime tiempo = rtc.now();
//Serial.println(tiempo.toString(formato1));
if ((digitalRead(BOTON_ARRIBA) == LOW) && (ARRIBA_APRETADO == 0)) {
opcion_seleccionada--;
ARRIBA_APRETADO = 1;
if(opcion_seleccionada < 0) {
opcion_seleccionada = numero_de_items - 1;
}
}
else if ((digitalRead(BOTON_ABAJO) == LOW) && (ABAJO_APRETADO == 0)) {
opcion_seleccionada++;
ABAJO_APRETADO = 1;
if(opcion_seleccionada >= numero_de_items) {
opcion_seleccionada = 0;
}
}
if ((digitalRead(BOTON_ARRIBA) == HIGH) && (ARRIBA_APRETADO == 1)) { // unclick
ARRIBA_APRETADO = 0;
}
if ((digitalRead(BOTON_ABAJO) == HIGH) && (ABAJO_APRETADO == 1)) { // unclick
ABAJO_APRETADO = 0;
}
}
if ((digitalRead(BOTON_SELECCION) == LOW) && (SELECCIONADOR_APRETADO == 0)) {
SELECCIONADOR_APRETADO = 1;
switch(opcion_seleccionada) {
case 0:
pantalla_actual = 1;
Serial.println("Submenu 1");
botonessub1(BOTON_ARRIBA, BOTON_ABAJO);
dibujosubmenu1();
break;
case 1:
pantalla_actual = 2;
Serial.println("Submenu 2");
break;
case 2:
pantalla_actual = 3;
Serial.println("Submenu 2");
break;
}
}
if ((digitalRead(BOTON_SELECCION) == HIGH) && (SELECCIONADOR_APRETADO == 1)) {
SELECCIONADOR_APRETADO = 0;
}
//Valores para opciones anteriores y opciones siguientes del menu principal
opcion_anterior = opcion_seleccionada - 1;
if(opcion_anterior < 0) {opcion_anterior = numero_de_items - 1;}
opcion_siguiente = opcion_seleccionada + 1;
if(opcion_siguiente >= numero_de_items) {opcion_siguiente = 0;}
if(pantalla_actual == 0) {
Serial.println(opcion_seleccionada);
dibujos();
}
}
void dibujosubmenu1() {
u8g.firstPage();
do {
u8g.setFont(u8g_font_7x14B);
u8g.drawStr(40, 14, items_de_submenu1[0]);
u8g.drawBitmapP( 2, 24, 16/8, 16, bitmap_iconos_dias[2]);
u8g.drawBitmapP( 20, 24, 16/8, 16, bitmap_iconos_dias[3]);
u8g.drawBitmapP( 38, 24, 16/8, 16, bitmap_iconos_dias[4]);
u8g.drawBitmapP( 56, 24, 16/8, 16, bitmap_iconos_dias[1]);
u8g.drawBitmapP( 74, 24, 16/8, 16, bitmap_iconos_dias[6]);
u8g.drawBitmapP( 92, 24, 16/8, 16, bitmap_iconos_dias[5]);
u8g.drawBitmapP( 110, 24, 16/8, 16, bitmap_iconos_dias[0]);
u8g.drawBitmapP( 47, 46, 16/8, 16, epd_bitmap__ICON_DOS_PUNTOS);
u8g.drawBitmapP( 0, 0, 128/8, 64, epd_bitmap__ICON_MARCO);
u8g.drawBitmapP( dias, 23, 24/8, 18, epd_bitmap__ICON_SELECCION_DIAS);
} while ( u8g.nextPage() );
}
void dibujos() {
u8g.firstPage();
do {
//Esta es la opción anterior del menú.
u8g.setFont(u8g_font_7x14);
u8g.drawStr(11, 14, items_de_menu[opcion_anterior]);
u8g.drawBitmapP( 108, 2, 16/8, 16, bitmap_iconos[opcion_anterior]);
//Esta es la opción que esta siendo seleccionada.
u8g.setFont(u8g_font_7x14B);
u8g.drawStr(11, 35, items_de_menu[opcion_seleccionada]);
u8g.drawBitmapP( 108, 24, 16/8, 16, bitmap_iconos[opcion_seleccionada]);
//Esta es la siguiente opción del menú
u8g.setFont(u8g_font_7x14);
u8g.drawStr(11, 58, items_de_menu[opcion_siguiente]);
u8g.drawBitmapP( 108, 46, 16/8, 16, bitmap_iconos[opcion_siguiente]);
u8g.drawBitmapP( 0, 22, 128/8, 21, epd_bitmap__parte_seleccionada);
u8g.drawBitmapP( 0, 0, 8/8, 64, epd_bitmap__scroll_background);
} while ( u8g.nextPage() );
}