Decode GPS data - Wio Terminal
In this part of the lesson, you will decode the NMEA messages read from the GPS sensor by the Wio Terminal, and extract the latitude and longitude.
Decode GPS data
Once the raw NMEA data has been read from the serial port, it can be decoded using an open source NMEA library.
Task - decode GPS data
Program the device to decode the GPS data.
-
Open the
gps-sensor
app project if it's not already open -
Add a library dependency for the TinyGPSPlus library to the projects
platformio.ini
file. This library has code for decoding NMEA data.lib_deps =
mikalhart/TinyGPSPlus @ 1.0.2 -
In
main.cpp
, add an include directive for the TinyGPSPlus library:#include <TinyGPS++.h>