Serial Graphic LCD 128x64

Hello all,

First of all I wan to say that I am a beginner in the Arduino andC language. I bought from Sparkfun a SerialGLCD 128X64. I tested it with the Graphic LCD Library program for the Arduino.

With this program it works OK. Base on this program I tried insert a program I made, but it does’nt work.

I am placing here a bit of the example program and a bit of mine as well as the error msg’s.

Example program:

void setup() {
  Serial.begin(115200); //default baudrate of the display, can be changed, consult summoningdark's README that comes with the firmware to change it
  delay(2000);
  
}

serialGLCD lcd; // initialisation

void loop() {
  
  lcd.clearLCD();
  // Allow for a short delay after clearLCD since it takes some time for the backpack to clear the entire screen
  delay(10);
  // Draw the sprite (int x, int y, int mode, int height, int width, byte data)
  // x and y defines the upper left corner to draw from, mode (same modes as text), height and width of the bitmap in pixels. sprite is the array of bytes.
  lcd.drawData(0,0,4,128,64,sprite6);
  delay(2000);  
  lcd.clearLCD();

Now a bit of my program ( I am puting only a smal portion of the program to not buther you if you this it is better put it all please let me know.):

void gps_position_print()
  {
   if (GPS_screen==0)
      {
      lcd.clearLCD();
      }
      else
      {
  GPS_screen=1;      
  lcd.gotoPosition(4,0);
  Serial.print("  GPS DATA  ");

The error msg’s are the following;

And I got the following errors :

" In function ‘void gps_position_prin()’:

" error ‘lcd’ was not declared in this scope"

In the example code we have the function " lcd.clearLCD(); and it doesn’t give error.

Can you please help in and give me some clues to solve the problem.

Thanks

Manuel

Is “serialGLCD lcd; // initialisation” declared globally? (Not inside any void setup/loop/etc function.