Problem: UTFT bitmap whitescreen

Hi guys,

I’m working with a TFT LCD screen and I’m using the UTFT library to display some bitmaps. I’ve been able to display a couple of bitmaps, but here comes the problem. Whenever I add another bitmap, my screen simply just whitescreens. The weird parts is that the bitmap I’m trying to add works when I switch it up with another one. My guess is that there is some kind of limit on the amount of bitmaps that can be used. Can any of you confirm or deny this theory?

Here is my code: (note, some of it is in Dutch)

#include <DS3231.h>
#include <URTouch.h>
#include <URTouchCD.h>
#include <memorysaver.h>
#include <UTFT.h>

UTFT myGLCD(ILI9341_16, 38, 39, 40, 41);
URTouch myTouch(6,5,4,3,2);
DS3231  rtc(SDA, SCL);

extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];

extern unsigned short AdjustTimeKnop[0x2710];
extern unsigned short AlarmKnop[0x2710];
extern unsigned short BackKnop[0x12C0];
extern unsigned short CancelKnop[0x1068];
extern unsigned short ResetKnop[0x11F8];
extern unsigned short SetAlarmKnop[0xD48];
extern unsigned short SettingsKnop[0x125C];
extern unsigned short MinKnop[0x780];
extern unsigned short PlusButton[0x780];

int x, y;
char huidigePagina;
int minuutAlarm, uurAlarm;

String huidigeKlok, tijdString, uurString, minuutString, secondeString;
String minuutAlarmString, uurAlarmString;

boolean AlarmAan, AlarmReactie;

void setup() {
  rtc.begin();
  myGLCD.InitLCD();
  myTouch.InitTouch();
  myTouch.setPrecision(PREC_MEDIUM); 
  
  Home();
  huidigePagina = '0';

  minuutAlarm = 0;
  uurAlarm = 0;

  AlarmAan = false;
  
}


void loop()
{
  if ( huidigeKlok != rtc.getTimeStr()) 
  {
      tijdString = rtc.getTimeStr();
      uurString = tijdString.substring(0, 2);
      minuutString = tijdString.substring(3, 5);
      secondeString = tijdString.substring(6, 8);

      minuutAlarmString == String(minuutAlarm, DEC);
      uurAlarmString == String(uurAlarm, DEC);

      if (AlarmAan == true);
      {
        if (uurString == uurAlarmString && minuutAlarmString == minuutString);
      {
        AlarmReactie = true;
        AlarmPagina();
        Bar();
        AlarmAan = false;
      }
      }
      
  }
  if (huidigePagina == '0')
  {
      myGLCD.setFont(SevenSegNumFont);
      myGLCD.setColor(0, 255, 0);
      myGLCD.print(secondeString, 224, 100);
      myGLCD.print(minuutString, 128, 100);
      myGLCD.print(uurString, 32, 100);
      myGLCD.fillCircle(113, 116, 5);
      myGLCD.fillCircle(113, 133, 5);
      myGLCD.fillCircle(208, 116, 5);
      myGLCD.fillCircle(208, 133, 5);
      Bar();

      
  }
            
      if (myTouch.dataAvailable()) 
      {
       myTouch.read();
      x = myTouch.getX(); 
      y = myTouch.getY();
      
      if ((x >= 210) && (x <= 320) && (y >= 183) && (y <= 240))
      {
      Menu();
      } 
      }
      
  
  if (huidigePagina == '1')
    {
      Bar();
      if (myTouch.dataAvailable()) 
      {
       myTouch.read();
       x = myTouch.getX();
       y = myTouch.getY();
      
      if ((x>=0) && (x<=110) && (y>=185) && (y<=240))
      {
      Home();
      }
      if ((x>=5) && (x<=205) && (y>=60) && (y<=110))
      {
      InstelAlarm();   
      }
      if ((x>=5) && (x<=205) && (y>=115) && (y<=165))
      {
      TijdBijstel();
      }
      }
    }
  if (huidigePagina == '2')
  {
    Bar();
    
    if (myTouch.dataAvailable()) 
      {
        myTouch.read();
        x = myTouch.getX();
        y = myTouch.getY();
      
      if ((x>=0) && (x<=110) && (y>=185) && (y<=240))//back
      {
      Menu();
      }     
      }
  }
  if (huidigePagina == '3')
  {
    Bar();

    if (myTouch.dataAvailable()) 
      {
        myTouch.read();
        x = myTouch.getX();
        y = myTouch.getY();
      
      if ((x>=0) && (x<=110) && (y>=185) && (y<=240))//back
      {
      Menu();
      }
      if ((x >= 210) && (x <= 320) && (y >= 183) && (y <= 240))
      {
      AlarmAan = true;
      x = 0;
      y = 0;
      Home();
      
      } 
    
    if (myTouch.dataAvailable()) 
      {
        myTouch.read();
        x = myTouch.getX();
        y = myTouch.getY();  
      
      if ((x>=90) && (x<=156) && (y>=50) && (y<=80))//+uur
      {
       uurAlarm = uurAlarm+1;
       
       
      }
      if ((x>=90) && (x<=156) && (y>=130) && (y<=160))//-uur
      {
        uurAlarm = uurAlarm-1;
        
      }
      
      if ((x>=170) && (x<=234) && (y>=50) && (y<=80))//+min
      {
        minuutAlarm = minuutAlarm+1;
        
      }
      if ((x>=170) && (x<=234) && (y>=130) && (y<=160))//-min
      {
        minuutAlarm = minuutAlarm-1;
        
      }
      if (uurAlarm > 23 )
      {
        uurAlarm = 0;
        
      }
      if (uurAlarm < 0)
      {
        uurAlarm = 23;
        
      }
      if (minuutAlarm >59)
      {
        minuutAlarm = 0;
       
      }
      if (minuutAlarm <0)
      {
        minuutAlarm = 59;
        
      }
      myGLCD.setFont(SevenSegNumFont);
      myGLCD.printNumI(uurAlarm, 90, 80, 2, '0');
      myGLCD.printNumI(minuutAlarm, 170, 80, 2, '0'); 
      }
      }
      
  }
 if (huidigePagina == '4')
 {
  
 }
  
}
void Home() {
  
  huidigePagina = '0';
  myGLCD.clrScr();
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.setColor(255, 255, 255); 
  myGLCD.setFont(BigFont); 
  myGLCD.drawBitmap( 215, 187, 100, 47, SettingsKnop);

}

void Menu()
{
  huidigePagina = '1';
  myGLCD.clrScr();
  myGLCD.setFont(BigFont);
  myGLCD.setColor(0,255,0);
  myGLCD.print(" Settings ", CENTER, 28); 
  myGLCD.drawBitmap(5, 60, 200, 50, AlarmKnop);
  myGLCD.drawBitmap(5, 115, 200, 50, AdjustTimeKnop);
  myGLCD.drawBitmap(5, 187, 100, 48, BackKnop);
}

void Bar()
{
      myGLCD.setFont(BigFont);
      myGLCD.setColor(0, 255, 0);
      myGLCD.print(rtc.getDateStr(), 10, 5);
      myGLCD.drawLine(0, 23, 319, 23);
      myGLCD.print(minuutString, 283, 5);
      myGLCD.print(uurString, 243, 5);
      myGLCD.fillCircle(279, 10, 2);
      myGLCD.fillCircle(279, 16, 2); 
}

void TijdBijstel()
{
  huidigePagina = '2';
  myGLCD.clrScr();
  myGLCD.drawBitmap(5, 187, 100, 48, BackKnop);
  
  
}

void InstelAlarm ()
{
  huidigePagina = '3';
  myGLCD.clrScr();
  myGLCD.drawBitmap(5, 187, 100, 48, BackKnop);
  myGLCD.setFont(SevenSegNumFont);
  myGLCD.fillCircle(160, 96, 4);
  myGLCD.fillCircle(160, 113, 4);
  myGLCD.printNumI(uurAlarm, 90, 80, 2, '0');
  myGLCD.printNumI(minuutAlarm, 170, 80, 2, '0');  
  myGLCD.setFont(BigFont);
  myGLCD.print("SET",215,187);
}

void AlarmPagina()
{
  if (AlarmReactie == true)
  {
  huidigePagina = '4';
  myGLCD.drawBitmap(CENTER, 150, 110,46, ResetKnop);
  myGLCD.clrScr();
  myGLCD.setFont(BigFont);
  myGLCD.print("ALARM", CENTER, CENTER);
}
}

Here is my code: (note, some of it is in Dutch)

Not true. It was all in C++.

      minuutAlarmString == String(minuutAlarm, DEC);
      uurAlarmString == String(uurAlarm, DEC);

What is the point of comparing these String, when you don't do anything if they match or if they don't match?

extern unsigned short AdjustTimeKnop[0x2710];
extern unsigned short AlarmKnop[0x2710];
extern unsigned short BackKnop[0x12C0];
extern unsigned short CancelKnop[0x1068];
extern unsigned short ResetKnop[0x11F8];
extern unsigned short SetAlarmKnop[0xD48];
extern unsigned short SettingsKnop[0x125C];
extern unsigned short MinKnop[0x780];
extern unsigned short PlusButton[0x780];

Not a single Arduino has this much memory.

Thanks, problem = solved!