Hello i have this GY-GPS6MV2
I try this code :
#include <SoftwareSerial.h>
#include <TinyGPS.h>
#define RXPIN 3
#define TXPIN 2
#define TERMBAUD 115200
#define GPSBAUD 4800
TinyGPS gps;
SoftwareSerial uart_gps(3, 2);
void getgps(TinyGPS &gps);
void setup()
{
Serial.begin(TERMBAUD);
uart_gps.begin(GPSBAUD);
Serial.println("");
Serial.println(" GPS Shield QuickStart Example Sketch v12 ");
Serial.println(" ...waiting for lock... ");
Serial.println("");
}
void loop()
{
while(uart_gps.available()) // While there is data on the RX pin...
{
int c = uart_gps.read(); // load the data into a variable...
if(gps.encode(c)) // if there is a new valid sentence...
{
getgps(gps); // then grab the data.
}
}
}
void getgps(TinyGPS &gps)
{
float latitude, longitude;
gps.f_get_position(&latitude, &longitude);
Serial.print(" Lat/Long : ");
Serial.print(latitude,5);
Serial.print(", ");
Serial.println(longitude,5);
int year;
byte month, day, hour, minute, second, hundredths;
gps.crack_datetime(&year,&month,&day,&hour,&minute,&second,&hundredths);
Serial.print(" Date: "); Serial.print(month, DEC); Serial.print("/");
Serial.print(day, DEC); Serial.print("/"); Serial.print(year);
Serial.print(" Time : "); Serial.print(hour, DEC); Serial.print(":");
Serial.print(minute, DEC); Serial.print(" : "); Serial.print(second, DEC);
Serial.print(" . "); Serial.println(hundredths, DEC);
Serial.print(" Altitude (meters) : "); Serial.println(gps.f_altitude());
Serial.print(" Course (degrees) : "); Serial.println(gps.f_course());
Serial.print(" Speed(kmph): "); Serial.println(gps.f_speed_kmph());
unsigned long chars;
unsigned short sentences, failed_checksum;
gps.stats(&chars, &sentences, &failed_checksum);
Serial.print(" Satellites : ");
Serial.println(gps.satellites());
}
but the output in the serial monitor is this:
"šn–ZÚ"
I can not read nothing..
Can you help me?'
Thanks
F.N.