GPS/GNSS UBX library for UART
Dependencies: Vector3
Diff: GPSUBX_UART.hpp
- Revision:
- 6:bde0ea0e2bfc
- Parent:
- 5:a92850395dcb
- Child:
- 7:580cdef44531
diff -r a92850395dcb -r bde0ea0e2bfc GPSUBX_UART.hpp --- a/GPSUBX_UART.hpp Fri Sep 17 16:30:14 2021 +0000 +++ b/GPSUBX_UART.hpp Fri Sep 17 16:39:28 2021 +0000 @@ -107,6 +107,37 @@ /**GPS/GNSS library for UART (UBX protocol) * RX pin is required. +*@code +*#include "mbed.h" +*#include "GPSUBX_UART.cpp" +* +*Serial pc(USBTX, USBRX, 115200); +* +*GPSUBX_UART gps(PD_1, PD_0); // mbed Nucleo 767 +* +*void Display() +*{ +* pc.printf("POSLLH: %d, %f, %f, %f\r\n", gps.iTOW_POSLLH, gps.Longitude, gps.Latitude, gps.Height); +* pc.printf("VELNED: %d, %f, %f, %f\r\n", gps.iTOW_VELNED, gps.VelocityNED.x, gps.VelocityNED.y, gps.VelocityNED.z); +* pc.printf("TIMEUTC: %4d/%2d/%2d %2d:%2d %2d\r\n", gps.Year, gps.Month, gps.Day, gps.Hours, gps.Minutes, gps.Seconds); +*} +* +*int main() +*{ +* gps.Attach(); +* int timer = 0; +* while (1) +* { +* gps.Update(); +* wait(0.1); +* timer++; +* if (timer >= 5) +* { +* Display(); +* timer = 0; +* } +* } +*} */ class GPSUBX_UART {