Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed MODSERIAL filter mbed-rtos ConfigFile PID PPM FreeIMU_external_magnetometer TinyGPS
Gps.h
00001 #include "mbed.h" 00002 #include "Global.h" 00003 #include <TinyGPS.h> 00004 #include "MODSERIAL.h" 00005 00006 #ifndef Gps_H 00007 #define Gps_H 00008 00009 class Gps 00010 { 00011 public: 00012 Gps(PinName gpsPinTx, PinName gpsPinRx); 00013 ~Gps(); 00014 00015 struct Value 00016 { 00017 double latitude; 00018 double longitude; 00019 double altitude; 00020 bool fix; 00021 }; 00022 00023 struct Difference 00024 { 00025 double x; 00026 double y; 00027 double bearing; 00028 double distance; 00029 }; 00030 00031 Value getValues(); 00032 Difference getDifference(Value latLong1, Value latLong2); 00033 00034 private: 00035 MODSERIAL *_gps; 00036 TinyGPS _tinyGPS; 00037 Value _values; 00038 double deg2rad(double deg); 00039 double rad2deg(double rad); 00040 }; 00041 00042 #endif
Generated on Fri Jul 15 2022 00:21:58 by
1.7.2