Gps not working

in trying to make the grove gps work with seeeduino xiao im using the code i found on here https://wiki.seeedstudio.com/Grove-GPS/ i just want to make it print the longitude and latitude in a simple format. here the code that it came with. i use chat gpt to make it work with the seeduino i just want it so show the cord in a simple way. any help is welcome.

sorry if my bad spelling

SoftwareSerial SoftSerial(2, 3);
unsigned char buffer[64];                   // buffer array for data receive over serial port
int count=0;                                // counter for buffer array
void setup()
{
   SoftSerial.begin(9600);                 // the SoftSerial baud rate
   Serial.begin(9600);                     // the Serial port of Arduino baud rate.
}

void loop()
{
   if (SoftSerial.available())                     // if date is coming from software serial port ==> data is coming from SoftSerial shield
   {
       while(SoftSerial.available())               // reading data into char array
       {
           buffer[count++]=SoftSerial.read();      // writing data into array
           if(count == 64)break;
       }
       Serial.write(buffer,count);                 // if no data transmission ends, write buffer to hardware serial port
       clearBufferArray();                         // call clearBufferArray function to clear the stored data from the array
       count = 0;                                  // set counter of while loop to zero 
   }
   if (Serial.available())                 // if data is available on hardware serial port ==> data is coming from PC or notebook
   SoftSerial.write(Serial.read());        // write it to the SoftSerial shield
}


void clearBufferArray()                     // function to clear buffer array
{
   for (int i=0; i<count;i++)
   {
       buffer[i]=NULL;
   }                      // clear all index of array with command NULL
}```

Welcome to the forum

Your topic has been moved to the Programming category of the forum as it had nothing to do with the category in which you originally posted it

Please be careful when choosing a forum category in which to start topics

oh ok thank you

The example provided by Seeed Studio should work without modification, although it will print GPS NMEA sentences and not simple latitude and longitude. Of course you have to wire the project correctly.

What happens when you try it?

this is what outputted. i just want the longitude and latitude.

$GPGGA,203538.086,,,,,0,0,,,M,,M,,*49

$GPGSA,A,1,,,,,,,,,,,,,,,*1E

$GPGSV,1,1,01,19,,,16*77

$GPRMC,203538.086,V,,,,,0.00,0.00,080424,,,N*46

The GPS is working fine, but the NMEA sentences show that the GPS unit does not have a satellite fix. You must be outdoors, with a clear view of the sky for several minutes to establish the fix.

For a simple printout of latitude and longitude, use tinyGPS++ to interpret the NMEA sentences.

oh ok il try that. i have tinyGPSplus will that work?

Yes.

sweet thank man

One satellite in view, extremly weak signal.

What you might expect if the GPS is indoors, or the GPS or its antenna are faulty.

Contact the supplier of the GPS perhaps.

If the GPS contiunes to report very weak signals, then no TinyGPSplus will not work.

Or take the GPS outside, to where there is a clear view of the sky.

thank you guys so much. hope you have a wonderful day. :slight_smile:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.