Hello!
This post is related to
Mega + Sainsmart TFT 320x240 very slow displaying bmp from SD card
The idea is to display 6 icons on the TFT and execute functions depending on which icon is pressed on the touch screen,
I tried to:
- load all the icons as a single file, "wallpaper" bmp, from the SD card then using myGLCD.setColor; and myGLCD.drawPixel but this is way too slow.
- convert the "wallpaper" with the 6 icons to a c_array file const unsigned short wallpaper[0x12C00] PROGMEM ={... but I got the error size of array 'wallpaper1’ is too large.
Now I'm trying this which is according to the bitmap example found in the UTFT library: - I converted the icons as 84x84 c_array files: icon1.c, icon2.c, ...
- Loading them with extern unsigned int icon1[0x1B90]; ...
- Displaying with myGLCD.drawBitmap (10, 26, 84, 84, icon1); ...
The images load quite fast.
The strange bug is this: if I try to display the 6 icons by using myGLCD.drawBitmap 6 times, the tft doesn't show anything. But if I comment one of the icons ( //myGLCD.drawBitmap ... ) the remaining 5 show up quite nice and fast.
And if I use 6 icons but at least 2 of them are the same image displayed in another place, it's also ok.
Can anyone explain what's wrong and how to fix it?
I'm guessing it's a size issue: 6 different images is too much for arduino.
Regards