UTFT Bitmap issue

I'm making a simple user interface using a 3.2 LCD Touch screen:
http://www.robotshop.com/en/3-2-tft-lcd-touch-shield-arduino.html

I'm using the UTFT libraries:
http://www.henningkarlsen.com/electronics/library.php?id=51

And having problems when it comes to using more than 2 drawBitmap commands. I start the whole program with a logo I created, then within the UI, I have two icons for weather and moon phases. Everything works fine if I have either the weather image OR the moon image, but not both. My guess is there's a memory issue. Here's my code:

Main:

#include <UTFT.h>
#include <UTouch.h>
#include <UTFT_Buttons.h>
#include <avr/pgmspace.h>

extern unsigned int logo[];

extern unsigned int New[];
extern unsigned int WaningCrescent[];
extern unsigned int ThirdQuarter[];
extern unsigned int WaningGibbous[];
extern unsigned int Full[];
extern unsigned int WaxingGibbous[];
extern unsigned int FirstQuarter[];
extern unsigned int WaxingCrescent[];

extern unsigned int Sunny[];
extern unsigned int PartlyCloudy[];
extern unsigned int Cloudy[];

extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t Dingbats1_XL[];

int pressedButton;

int homeButton, settingsButton, alertButton, offButton, timeButton,
    lightingButton, dosingButton, devicesButton, logButton, aboutButton;

UTFT           mainDisplay(ITDB32S, 38,39,40,41);
UTouch         inputTouch(6,5,4,3,2);
UTFT_Buttons   inputButtons(&mainDisplay, &inputTouch);

void setup() {
  mainDisplay.InitLCD();
  mainDisplay.clrScr();
  mainDisplay.drawBitmap(1,0,106,80,logo,3);
  mainDisplay.setFont(BigFont);
  
  inputTouch.InitTouch();
  inputTouch.setPrecision(PREC_MEDIUM);
  
  inputButtons.setTextFont(SmallFont);
  inputButtons.setSymbolFont(Dingbats1_XL);
  inputButtons.setButtonColors(VGA_YELLOW, VGA_RED, VGA_YELLOW, VGA_BLUE, VGA_GRAY);
  
  delay(1000);
  drawHomePage();
}

void loop() {
  if (inputTouch.dataAvailable() == true)
  {
    pressedButton = inputButtons.checkButtons();
    
    if(pressedButton == aboutButton)
      drawAboutPage();
    if(pressedButton == homeButton)
      drawHomePage();
  }
}

Load Pages:

void drawToolbar() {
  
  //Top
  mainDisplay.fillRoundRect(0,0,319,25);
  //Bottom
  mainDisplay.fillRoundRect(0,213,319,238);
  
  homeButton     = inputButtons.addButton(   1, 214,  80, 23, "HOME");
  settingsButton = inputButtons.addButton(  81, 214,  79, 23, "SETTINGS");
  alertButton    = inputButtons.addButton( 160, 214,  79, 23, "ALERTS");
  offButton      = inputButtons.addButton( 239, 214,  80, 23, "POWER");
  timeButton     = inputButtons.addButton( 160,   1, 158, 23, "MM/DD/YYYY ##:##");
  
  inputButtons.drawButtons();
}

void drawHomePage() {
  mainDisplay.clrScr();
  inputButtons.deleteAllButtons();
  drawToolbar();
  
  mainDisplay.drawBitmap(220, 30, 96, 96, WaxingCrescent);
  //mainDisplay.drawBitmap(110, 30, 96, 96, PartlyCloudy);
  
  lightingButton = inputButtons.addButton( 1,  30, 100, 34, "LIGHTING");
  dosingButton   = inputButtons.addButton( 1,  66, 100, 34, "QUALITY");
  devicesButton  = inputButtons.addButton( 1, 102, 100, 34, "DEVICES");
  logButton      = inputButtons.addButton( 1, 138, 100, 34, "LOG BOOK");
  aboutButton    = inputButtons.addButton( 1, 174, 100, 34, "ABOUT");
  
  inputButtons.drawButtons();
}

Is there a command to clear memory of one of those bitmaps since I'm not using the logo at the same time as the weather and moon icons?
Thanks for any help!

Is there a command to clear memory of one of those bitmaps since I'm not using the logo at the same time as the weather and moon icons?

No.

Posting ALL of your code would mean that we don't need to guess where your data is actually stored.

seen this problem

  1. if the bit map gets pushd off screen it fails

  2. if bitmaps overlap

You can try and delay between the two loads to allow library to render, this should show what happening..
8) 8)

PaulS:

Is there a command to clear memory of one of those bitmaps since I'm not using the logo at the same time as the weather and moon icons?

No.

Posting ALL of your code would mean that we don't need to guess where your data is actually stored.

The image is stored where the program is stored on my PC in a .c file and there are several more obviously just like it. There's one attached since it's too big to post.

tgsuperspec:
seen this problem

  1. if the bit map gets pushd off screen it fails

  2. if bitmaps overlap

You can try and delay between the two loads to allow library to render, this should show what happening..
8) 8)

Yea, I ran into the first problem when I first started. The images aren't trying to load off screen. They each will load in their respective locations on their own, just not when I try to load them all in the same program. The logo appears first in my program then is cleared by the clrScr() command. Is it technically still there even though I can't see it and is that why adding an image later breaks the program? Is there a different way I need to remove the image?

I tried adding a delay between loading the two icons and still got the same results. The program won't even run at all if I try to load 3 images at any time throughout.

Full.c (87.4 KB)

Looked at full.c and size could be a problem...

I found that bitmap arrays of that size seemed to give the UTFT library a problem.
I would also suggest you remov the ?UButton use and get the two logo's working.

I found the UButton Library to be too big so I wrote mt own detection system for 32x32 Icons buttons, ignored the need to get Up and Down images etc., just simple detection of touch in the 32x 32 area of the screen

If you want to send me all the sources will include the logos in my Engine management system test bed, but I will have to have the imges reduced from the 9000+ of your image you posed..

I was originally just going to test for a touch within a region till I saw his UTFT_Button Library. My images are all 96x96 except for the logo which is even larger. Let me try what you're suggesting and shrink everything down to see if it works...