//coordinates in decimal format
//e.g. 52.520817 13.40945
typedef struct{
float lat;
float lon;
} geoCoordinate_t;
double distanceKm =
TinyGPSPlus.distanceTo(
gps.location.lat(),
gps.location.lng(),
EIFFEL_TOWER_LAT,
EIFFEL_TOWER_LNG) / 1000.0;
double courseTo =
TinyGPSPlus.courseTo(
gps.location.lat(),
gps.location.lng(),
EIFFEL_TOWER_LAT,
EIFFEL_TOWER_LNG);
if (gpsSerial.available()){
gps.encode(gpsSerial.read());
}
while(gpsSerial.available() > 0){
gps.encode(gpsSerial.read());
}
$GPRMC,000229.000,V,,,,,,$GPGGA,000229.199,,,,,0,0,,,M,,M,,*40
$GPRMC,000229.199,V,,,,,0$GPGGA,000229.400,,,,,0,0,,,M,,M,,*45
$GPRMC,000229.400,V,,,,,$GPGGA,000229.599,,,,,0,0,,,M,,M,,*44
$GPRMC,000229.599,V,,,,,.$GPGGA,000229.800,,,,,0,0,,,M,,M,,*49
$GPRMC,000229.800,V,,,,,$GPGGA,000230.000,,,,,0,0,,,M,,M,,*49
$GPRMC,000230.000,V,,,,,0$GPGGA,000230.199,,,,,0,0,,,M,,M,,*48
$GPRMC,000230.199,V,,,,,$GPGGA,000230.400,,,,,0,0,,,M,,M,,*4D
#include <SoftwareSerial.h>
SoftwareSerial mySerial(8, 11); // RX, TX
void setup()
{
Serial.begin(38400);
mySerial.begin(38400);
}
void loop() // run over and over
{
if (mySerial.available()){
uint8_t c = mySerial.read();
Serial.write(c);
}
}