Arduino Forum

Using Arduino => Displays => Topic started by: ipkiller86 on Jan 24, 2020, 08:29 pm

Title: ShowBmp on tft screen
Post by: ipkiller86 on Jan 24, 2020, 08:29 pm
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
Title: Re: ShowBmp on tft screen
Post by: david_prentice on Jan 24, 2020, 08:48 pm
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.
Title: Re: ShowBmp on tft screen
Post by: ipkiller86 on Jan 24, 2020, 10:35 pm
i tried your code im getting this error

Title: Re: ShowBmp on tft screen
Post by: david_prentice on Jan 24, 2020, 10:52 pm
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.
Title: Re: ShowBmp on tft screen
Post by: ipkiller86 on Jan 25, 2020, 02:03 am

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

Title: Re: ShowBmp on tft screen
Post by: david_prentice on Jan 25, 2020, 11:26 am
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.