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: Lib_Cntrl AHRS Lib_Misc
Xtra_Sensors/GPS.h@4:dc844fde64d7, 2019-11-22 (annotated)
- Committer:
- Kiwicjam
- Date:
- Fri Nov 22 08:40:26 2019 +0000
- Revision:
- 4:dc844fde64d7
- Parent:
- 2:e7874762cc25
Workin set, not running,
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
altb2 | 2:e7874762cc25 | 1 | #include "mbed.h" |
altb2 | 2:e7874762cc25 | 2 | #include "Signal.h" |
altb2 | 2:e7874762cc25 | 3 | #define buffer_size 255 |
altb2 | 2:e7874762cc25 | 4 | #include "string" |
altb2 | 2:e7874762cc25 | 5 | #include "PID_Cntrl.h" |
altb2 | 2:e7874762cc25 | 6 | #define EARTH_RADIUS 6378137 |
altb2 | 2:e7874762cc25 | 7 | |
altb2 | 2:e7874762cc25 | 8 | class GPS{ |
altb2 | 2:e7874762cc25 | 9 | public: |
altb2 | 2:e7874762cc25 | 10 | GPS(PinName,PinName,float); |
altb2 | 2:e7874762cc25 | 11 | virtual ~GPS(); |
altb2 | 2:e7874762cc25 | 12 | void get_data(void); |
altb2 | 2:e7874762cc25 | 13 | double pos_xyz[3]; |
altb2 | 2:e7874762cc25 | 14 | void get_position(void); |
altb2 | 2:e7874762cc25 | 15 | RawSerial logGPS; |
altb2 | 2:e7874762cc25 | 16 | void return_string(string *); |
altb2 | 2:e7874762cc25 | 17 | private: |
altb2 | 2:e7874762cc25 | 18 | Signal signal; |
altb2 | 2:e7874762cc25 | 19 | Thread thread; |
altb2 | 2:e7874762cc25 | 20 | Ticker ticker; |
altb2 | 2:e7874762cc25 | 21 | Mutex mutex; // mutex to lock critical sections |
altb2 | 2:e7874762cc25 | 22 | double pos0_xyz[3]; |
altb2 | 2:e7874762cc25 | 23 | uint8_t rx_in; |
altb2 | 2:e7874762cc25 | 24 | char c; |
altb2 | 2:e7874762cc25 | 25 | bool buffer_filled; |
altb2 | 2:e7874762cc25 | 26 | void sendSignal(); |
altb2 | 2:e7874762cc25 | 27 | void Rx_interrupt(); |
altb2 | 2:e7874762cc25 | 28 | char buf[buffer_size]; |
altb2 | 2:e7874762cc25 | 29 | string str; |
altb2 | 2:e7874762cc25 | 30 | double ph_th0[2]; |
altb2 | 2:e7874762cc25 | 31 | |
altb2 | 2:e7874762cc25 | 32 | }; |