myGLCD.InitLCD causes program to hang

Hello all. I have a rather complicated project running on a Mega with a ST7735S 1.8" TFT. When I test the TFT alone with only this code in setup, the LCD runs fine. However i have no input device in this test program, so I do not know if it will respond to input.

void setup() {
  myGLCD.InitLCD();
  myGLCD.clrScr();
}

However when I add the same code to my main project (at the bottom of this block), the program seems to hang after the InitLCD command. If I take that command out, the program runs fine, but as soon as that one line of code is inserted, the program stops responding to input commands. In fact, if I put the InitLCD command at the beginning of setup, the rest of the setup hangs.

void setup()
{

#ifndef CDC_ENABLED
  // bridge mode?
  if (bridge.check())
  {
    cli();
    bridge.loop(0, 1, 12, 13);
  }

  // run normally
  Serial.begin(9600);
  Serial.println("Bridge not started!");

#else
  // bridge mode?
  if (bridge.check())
  {
    port.begin(9600);
    bridge.loop(port);
  }
  Serial.println("Bridge connection aborted!");

#endif

  port.begin(9600);
  while (!easyvr.detect())
  {
    Serial.println("EasyVR not detected!");
    delay(1000);
  }

  easyvr.setPinOutput(EasyVR::IO1, LOW);
  Serial.println("EasyVR detected!");
  easyvr.setTimeout(5);
  easyvr.setLanguage(0);

  group = 1; //<-- start group (customize)

  Serial.println("DHT22 active!");
  dht.begin();
  mySwitch.enableTransmit(4);  // <----- change this accordingly
  myGLCD.InitLCD();
  myGLCD.clrScr();
}

At first I thought that maybe the project wasn't getting enough power to run the TFT (a problem I ran into in another project) so I hooked up my external power with no luck. Anyone know why this might be happening and how I can fix it? Thank you in advance!

Note: EasyVR is my speech recognition shield. That's what receives the input commands.

Anyone know why this might be happening

Yes. There is something wrong with your code.

and how I can fix it?

The IDE is one way. Any good text editor, or even a poor one, is another.

As to what changes you need to make, POST ALL OF YOUR CODE!

PaulS:
As to what changes you need to make, POST ALL OF YOUR CODE!

I was going to do that, but I didn't want to be chided for walls of text like I have been in the past. But since it is now requested of me, I've attached the .ino because the code itself is too long to put in this message (limit of 9000 characters).

Let's leave InitLCD at the end of setup. Upon further inspection, when I look at the serial monitor, the last line displayed is "Say a command in Group 1" which comes from void loop, but it doesn't progress. It's as if easyvr.recognizeCommand doesn't activate after the LCD has been initialized.

EDIT: And the LCD doesn't initialize as nothing is displayed on screen.

beduino_v7.1.ino (8.36 KB)

EDIT: And the LCD doesn't initialize as nothing is displayed on screen.

When do you print to it? Only after a voice command is recognized. Print to it BEFORE then to see if it is actually working.

I suspect that you have a pin conflict. You need to assure yourself that the LCD and the EasyVR shield are not trying to use the same pin.

Using SoftwareSerial on the Mega, which has 4 hardware serial ports, doesn't make sense.

PaulS:
I suspect that you have a pin conflict. You need to assure yourself that the LCD and the EasyVR shield are not trying to use the same pin.

Ha, I didn't even think of that. Pin 12 was causing a conflict so I switched the LCD pin and updated my code accordingly and now it works just fine. Thank you very much!

Using SoftwareSerial on the Mega, which has 4 hardware serial ports, doesn't make sense.

I believe that is part of the generated code from the EasyVR software. From my understanding, SoftwareSerial is really only necessary when you don't have enough TX/RX pins, is that correct?

From my understanding, SoftwareSerial is really only necessary when you don't have enough TX/RX pins, is that correct?

Or are too lazy to convert from SoftwareSerial to HardwareSerial.