Showing GPS output on LCD

Hello Everone,
I am using NEO6M GPS module for extraction of location coordinates. I have managed to get GPS signal by setting the u-center. I have connected the Neo6m via arduino and LCD. Once I get GPS coordinates i want to print GPS Enabled on LCD but instead of this the GPS strings start coming on LCD. I have placed code tell me where i m wrong?
Thanks to all

#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// Choose two Arduino pins to use for software serial
int RXPin = 6;
int TXPin = 7;

//Default baud of NEO-6M is 9600
int GPSBaud = 9600;

// Create a software serial port called "gpsSerial"


SoftwareSerial gpsSerial(RXPin, TXPin);

void setup()
{
  // Start the Arduino hardware serial port at 9600 baud
  Serial.begin(9600);


  // set up the LCD's number of columns and rows:


  lcd.begin(16, 2);
 
  pinMode(9, OUTPUT);
void loop()
{
  // Displays information when new sentence is available.
  if (gpsSerial.available())


    Serial.write(gpsSerial.read());


    // Print a message to the LCD.
    {lcd.print("GPS ENABLED");


    digitalWrite(9, HIGH);
}
}

That code doesn't even compile. You don't have a closing brace on 'setup', before you start 'loop'.

instead of this the GPS strings start coming on LCD.

Have you uploaded the correct code ?
The posted code does not write GPS data to the LCD

My question is not to show the GPS data on LCD. I just want the LCD to write "GPS ENABLED" once my module receives data. For that, I don't know how to code because once I run this code all the NMEA strings or RAW GPS data start on an LCD screen which i don't want to show.

once I run this code all the NMEA strings or RAW GPS data start on an LCD screen

I find that very difficult to believe as the code does not even compile, as was been pointed out in reply #1

With that problem fixed the only output to the LCD is

    lcd.print("GPS ENABLED");

The GPS data is sent to the Serial interface and will appear on the Serial monitor if you have it open and set to the correct baud rate. Is that where you are seeing the GPS data ?

Do any of the examples from the LCD library work ?

arooj16088002:
My question is not to show the GPS data on LCD. I just want the LCD to write "GPS ENABLED" once my module receives data.

Depends what you mena by 'data';

Any noise the serial interface sees and confuses them for characters.

Valid characters, but some corrupt ones, so no valid NMEA sentences.

Valid characters with valid NMEA sentences.

Valid characters with valid NMEA senetences when the GPS has a valid location fix.

A GPS with a valid time lock.

It was noise confused with NMEA characters which was shown on LCD screen.
I don't want to show incoming data from GPS to any serial monitor or LCD screen. I just want to print ENABLED once the data reception is detected by the receiver. It's more like an indication.

It was noise confused with NMEA characters which was shown on LCD screen.

Can you post a photograph of the LCD screen showing GPS data

Comment out the code that reads and prints the GPS data in your sketch. What, if anything appears on the LCD ? I note that your code does not clear the LCD or position the cursor before printing "GPS ENABLED" every time through loop() when GPS data is available. That may cause all sorts of problems. Clear the LCD and position the cursor before printing to the LCD

How I can clear the LCD Screen each time?

This is image of LCD.

arooj16088002:
How I can clear the LCD Screen each time?

The usual function is

lcd.clear()

which clears the screen and puts the cursor at position 0,0 so that the next print is at that position

Have you looked at the examples from the LCD library that you are using ?

No, i haven't seen the examples from the LCD library.

i have attached the figure.

arooj16088002:
No, i haven’t seen the examples from the LCD library.

Then I suggest that you look at them. They usually include a simple “Hello World” sketch that simply prints text to the LCD

You can access them from the IDE by looking in File->Examples

I have done that hello world example and printed out the HELLO WORLD on LCD too. But once I do after connecting GPS module like If I insert

while (gpsSerial.available() > 0)
    Serial.write(gpsSerial.read());
lcd.print(HELLO Wrld)

It will print Hello World for once and after that all Received garbage values from GPS module is shown on screen as in figure given above. I dont want that garbage value on LCD i just want that GPS ENABLED should stay on LCD.

like If I insert

…it won’t compile.

Please don’t waste time

Please post the code that you used when you got the problem described in reply #15

UKHeliBob:
Please post the code that you used when you got the problem described in reply #15

#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// Choose two Arduino pins to use for software serial
int RXPin = 6;
int TXPin = 7;

//Default baud of NEO-6M is 9600
int GPSBaud = 9600;

// Create a software serial port called "gpsSerial"
SoftwareSerial gpsSerial(RXPin, TXPin);

void setup()
{
  // Start the Arduino hardware serial port at 9600 baud
  Serial.begin(9600);
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
}

void loop()
{
  // Displays information when new sentence is available.
  if (gpsSerial.available())
    Serial.write(gpsSerial.read());
    // Print a message to the LCD.
    {lcd.print("GPS ENABLED");
}
}

I see that you ignored the advice to clear the LCD and set the cursor position before printing the message to it. Why ?

Try this

#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// Choose two Arduino pins to use for software serial
int RXPin = 6;
int TXPin = 7;

//Default baud of NEO-6M is 9600
int GPSBaud = 9600;

// Create a software serial port called "gpsSerial"
SoftwareSerial gpsSerial(RXPin, TXPin);

void setup()
{
  // Start the Arduino hardware serial port at 9600 baud
  Serial.begin(9600);
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
}

void loop()
{
  // Displays information when new sentence is available.
  if (gpsSerial.available())
    Serial.write(gpsSerial.read());
  // Print a message to the LCD.
  {
    lcd.clear();  //clear the LCD and set the cursor to 0, 0
    lcd.print("GPS ENABLED");
  }
}