Go Down

Topic: ShowBmp on tft screen (Read 455 times) previous topic - next topic

ipkiller86

Hi Good Evening
i am running on Arduino mega with a Elegoo 2.8 with sd card inch screen i have this sketch "test" that i have been working on
i am trying to show a bmp for 3 seconds before the main sketch starts the only way i found to be able to show images on screen was using showBMP_not_Uno but i cant change it to display one image for 3 seconds it just loops and how would i approach adding this on my test sketch

david_prentice

#1
Jan 24, 2020, 08:48 pm Last Edit: Jan 24, 2020, 08:49 pm by david_prentice
In setup()
Code: [Select]

    ...
    bool good = SD.begin(SD_CS);
    if (!good) {
        Serial.print(F("cannot start SD"));
        while (1);
    }
    showBMP("logo.bmp", 0, 0);
    delay(3000);
}


void loop()
{
    // replace with your application code
}


There are programs on your PC to convert logo.jpg tp logo.bmp

Your logo is monochrome.   You could save it as a monochrome bitmap.    You could put this in an array in PROGMEM.    And show on your screen with Adafruit_GFX method:
Code: [Select]

    drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
      int16_t w, int16_t h, uint16_t color, uint16_t bg),


David.

ipkiller86

i tried your code im getting this error


david_prentice

#3
Jan 24, 2020, 10:52 pm Last Edit: Jan 24, 2020, 10:54 pm by david_prentice
did you copy the showBMP() function ?

Life is much easier with your logo as an array in PROGMEM.

I provide MCUFRIEND_kbv examples that show this.

I don't know whether Elegoo have copies my examples.

Oh,  please copy-paste text messages.   It is annoying to open a JPG.   And the reader can not copy-paste text from a JPG.

David.

ipkiller86


with the draw function i have tried with no luck can you show an example perhaps
i really dont know what im doing wrong


david_prentice

#5
Jan 25, 2020, 11:26 am Last Edit: Jan 25, 2020, 11:27 am by david_prentice
Here is an example that shows a monochrome bitmap from array in PROGMEM. for 3 seconds.

Then displays the BMP format file from SD card for 3 seconds.

The BMP file looks much nicer but you only want to show it for a short time.

David.

Go Up