CYTRON SKM53 GPS SHIELD WITH ARDUINO UNO
Posted: Mon Nov 20, 2017 3:10 pm
Hi... I've been editing the programming of my gps shield + uno.
my aim is to get the latitude and longitude only.
after testing, the serial monitor display both for latitude and longitude 0.000000
Thus, can someone help what i need to do to get the correct value. Below are my code and output result attached.
Thank You..
my aim is to get the latitude and longitude only.
after testing, the serial monitor display both for latitude and longitude 0.000000
Thus, can someone help what i need to do to get the correct value. Below are my code and output result attached.
Thank You..
- CODE: SELECT_ALL_CODE
#include <TinyGPS.h>
#include <SoftwareSerial.h>
SoftwareSerial ss(0,1); //software serial pin for skm53 shield
TinyGPS gps;
float flat,flon;
void setup()
{
Serial.begin(9600);
ss.begin(9600);
Serial.print("");
Serial.print("Acquiring gps");
Serial.print("");
}
void loop()
{
while(ss.available())
{
char c=ss.read();
if(gps.encode(c))
{
gps.f_get_position(&flat,&flon);
}
{
Serial.println("");
Serial.print("Latitude:");
Serial.println(flat, 6);
Serial.print("Longitude:");
Serial.println(flon, 6);
delay(10000);
}
}
}