Mega 2560 board interfaced to Smart GPU2 LCD display

Hello,
I am having problems communicating to the Smart GPU2 LCD from a Ardunio mega2560. I can send commands
using the Serial Monitor available in the Ardunio environment with success. I can change background color.
For example, I send "U’, followed by “MCFFFF” and “ME” to change the background color to GREEN using the
Serial Monitor.

But when I write a few lines as a program to send these commands,
nothing happens. I have also tried using the examples for the GPU2 LCD available from Ardunio. None of them
do anything. One of the examples is called ARC, or Window. The programs compile without any error but nothing
happens on the screen. I have already transfered the GPU2 Library into the Ardunio Library directory.
I think all these example were written for a different Ardunio board. Please note that I have jumpered TX/RX lines from the
GPU2 LCD to RX0/TX0 of the MEGA2560.
I have also connected the Mega2560 to the PC using the USB port.

Please Help

Thanks

Post your code. Since you have a Mega, it might be a better idea to connect the LCD to one of the other serial ports.

Hello,

I have attached one of the examples called “Rectangles”

/********************************************************
IMPORTANT : This Example is created for the Arduino 1.0 Software IDE
********************************************************/

#include <SMARTGPU2.h> //include the SMARTGPU2 library!

SMARTGPU2 lcd; //create our object called LCD

//
/
/
void setup() { //initial setup
//Those two functions must always be called for SMARTGPU2 support
lcd.init(); //configure the serial and pinout of arduino board for SMARTGPU2 support
lcd.start(); //initialize the SMARTGPU2 processor
}

//
/
/
//
/
/
void loop() { //main loop draw random colour and size lines
POINT p1, p2;
COLOUR colour;
FILLGEOM fill;

lcd.baudChange(BAUD6); //for fast drawing we need a big baudRate

while(1){//forever
randomSeed(random(0,65536)); //set different seeds to obtain a good random number
p1.x=random(0,LCD_WIDTH); //get a random number 0-319
p1.y=random(0,LCD_HEIGHT); //get a random number 0-239
p2.x=random(0,LCD_WIDTH); //get a random number 0-319
p2.y=random(0,LCD_HEIGHT); //get a random number 0-239
colour=random(0,65536); //get a random number 0-65535
fill=(FILLGEOM)random(0,2); //get a random number 0-1

//draw the rectangle
if(lcd.drawRectangle(p1.x,p1.y,p2.x,p2.y,colour,fill) != ‘O’){ //draw a rectangle
while(1); //loop forever if different than ‘O’–OK
}
}
}

Thanks

Rectangles.ino (2.55 KB)