So I am using Dragino Lora GPS Shield to get the gps readings. The tiny gps example works just fine but for some reason in a different code , I am unable to get the correct readings. I have attached the code and the thethingsnetwork payload image.
void GPSRead()
{
unsigned long age;
gps.f_get_position(&flat, &flon, &age);
falt=gps.f_altitude(); //get altitude
flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6;//save six decimal places
flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6;
falt == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : falt, 2;//save two decimal places
int32_t lat = flat * 10000;
int32_t lon = flon * 10000;
int32_t alt = falt * 100;
mydata[10] = lat >> 16;
mydata[11] = lat >> 8;
mydata[12] = lat;
mydata[13] = lon >> 16;
mydata[14] = lon >> 8;
mydata[15] = lon;
mydata[16] = alt >> 16;
mydata[17] = alt >> 8;
mydata[18] = alt;
}