How do I implement a boot screen

kabal37
Posts: 5
Joined: Fri Jul 29, 2022 1:03 pm

How do I implement a boot screen

Postby kabal37 » Wed Aug 03, 2022 6:54 pm

Hello guys
I have a ST7735S (1.8inch screen) / no micro SD slot
I want to add my picture when I power on the device, then the device should move to my other code.
I found I could use BITMAP to flash memory, but when I use the "ESp8266-ST7735-bitmap-main" file I don't get the picture over the whole screen.

Can someone tell me how i could adjust the code to suit my display ( 128x160)
And how can I like make the boot picture stay on like for 5s then move to my other code

Code: Select all

#include <SPI.h>
#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library

#define TFT_CS        5
#define TFT_RST        4 // Or set to -1 and connect to Arduino RESET pin
#define TFT_DC         2

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

float p = 3.1415926;

void setup(void) {
  Serial.begin(9600);
  Serial.print(F("Hello! ST77xx TFT Test"));

  // Use this initializer if using a 1.8" TFT screen:
  tft.initR(INITR_BLACKTAB);      // Init ST7735S chip, black tab
  tft.setRotation(1); // set display orientation 
}

void loop() {
  tft.fillScreen(ST77XX_BLACK);
  print_text(20,5,"1.54",5,ST77XX_GREEN);
  print_text(70,50,"BAR",2,ST77XX_GREEN);
  print_text(5,90,"Temp motora: 81'C",1,ST77XX_WHITE);
  print_text(5,100,"Temp usisa: 30'C",1,ST77XX_BLUE);
  print_text(146,116,"AM",1,ST77XX_WHITE);
  

  delay(5000);
  
  
}

void print_text(byte x_pos, byte y_pos, char *text, byte text_size, uint16_t color) {
  tft.setCursor(x_pos, y_pos);
  tft.setTextSize(text_size);
  tft.setTextColor(color);
  tft.setTextWrap(true);
  tft.print(text);
}

Who is online

Users browsing this forum: No registered users and 101 guests