How to Read BMP from Spiffs and Display to OLED

waqast
Posts: 1
Joined: Sun Jun 28, 2020 6:06 pm

How to Read BMP from Spiffs and Display to OLED

Postby waqast » Sun Jun 28, 2020 6:51 pm

I have uploaded a splash.bmp in ESP32 SPIFFS and wan't to display it as Splash screen on startup.
How to make it work as codes around the internet are for SD Cards only.

Code: Select all

#include "SPIFFS.h"
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#include <SPI.h>
#define TFT_CS         5
#define TFT_RST        4
#define TFT_DC         2

Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);

void setup(void) {
  Serial.begin(9600);
  Serial.println(F("Setup Initiated"));
  if (!SPIFFS.begin(true)) {
    Serial.println(F("An Error has occurred while mounting SPIFFS"));
    return;
  }
  File root = SPIFFS.open("/");
  File file = root.openNextFile();
  while(file){
      Serial.print("FILE: ");
      Serial.println(file.name());
      file = root.openNextFile();
  }
  tft.initR(INITR_MINI160x80);
  tft.setRotation(3);
  tft.fillScreen(ST77XX_BLACK);
}

void loop() {

}

Who is online

Users browsing this forum: No registered users and 82 guests