#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display(-1);
#define DIS_WIDTH 128 // OLED display width, in pixels
#define DIS_HEIGHT 64 // OLED display height, in pixels
#define IMG_HEIGHT 32
#define IMG_WIDTH 32
// 'Skull', 32x32px
const unsigned char epd_bitmap_Skull [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0xc0, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x7f, 0xfe, 0x00,
0x00, 0x7f, 0xfe, 0x00, 0x0c, 0xff, 0xff, 0x30, 0x0e, 0xff, 0xff, 0x70, 0x1f, 0xff, 0xff, 0x78,
0x3f, 0xff, 0xff, 0xfc, 0x1f, 0xff, 0xff, 0xf8, 0x0f, 0x63, 0xc6, 0xf0, 0x00, 0x41, 0x82, 0x00,
0x00, 0x41, 0x82, 0x00, 0x00, 0x42, 0x42, 0x00, 0x00, 0x7e, 0x7e, 0x00, 0x00, 0x7e, 0x7e, 0x00,
0x00, 0x27, 0xf4, 0x00, 0x00, 0x77, 0xee, 0x00, 0x1f, 0xff, 0x7f, 0xf8, 0x1f, 0xdf, 0xfb, 0xf8,
0x1f, 0x9f, 0xf9, 0xf8, 0x0f, 0x0f, 0xf0, 0xf0, 0x0e, 0x0f, 0xf0, 0x70, 0x00, 0x03, 0xc0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// Array of all bitmaps for convenience. (Total bytes used to store images in PROGMEM = 144)
const int epd_bitmap_allArray_LEN = 1;
const unsigned char* epd_bitmap_allArray[1] = {
epd_bitmap_Skull
};
void showWelcomeMessage() {
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.println("Bienvenidos a");
display.println("Sistemas de Control");
display.println("Embebidos");
display.println("By: Patricio Gonzalez");
display.display();
// Esperar unos segundos antes de continuar mostrando la velocidad
delay(2000);
}
void setup() {
Serial.begin(9600);
// Inicializar el display proporcionando el tipo de display y su dirección I2C.
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 está fallando"));
for (;;); // No proceder, hacer un bucle infinito
}
delay(2000); // Pausa de 2 segundos
// Mostrar la imagen al inicio
int xOffset = (DIS_WIDTH - IMG_WIDTH) / 2;
int yOffset = (DIS_HEIGHT - IMG_HEIGHT) / 2 - 15; // Mueve la imagen 20 píxeles hacia abajo
display.clearDisplay();
display.drawBitmap(xOffset, yOffset, epd_bitmap_allArray[0], IMG_WIDTH, IMG_HEIGHT, WHITE);
display.display();
delay(2000); // Pausa de 2 segundos antes de mostrar el mensaje de bienvenida
// Mostrar el mensaje de bienvenida
showWelcomeMessage();
}
void loop()
{
}