NMEA0813フォーマットのGPSから情報を取り出すプログラムです。
Dependents: GPS_test EM_Logger
nmea0813.h@0:42a334c405de, 2013-03-29 (annotated)
- Committer:
- YSB
- Date:
- Fri Mar 29 05:55:53 2013 +0000
- Revision:
- 0:42a334c405de
- Child:
- 1:f4d3c59a4917
- Child:
- 2:7870c69fa58c
ver.1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
YSB | 0:42a334c405de | 1 | #ifndef _INC_NMEA0813 |
YSB | 0:42a334c405de | 2 | #define _INC_NMEA0813 |
YSB | 0:42a334c405de | 3 | |
YSB | 0:42a334c405de | 4 | #define CR 0x0D |
YSB | 0:42a334c405de | 5 | #define LF 0x0A |
YSB | 0:42a334c405de | 6 | |
YSB | 0:42a334c405de | 7 | #include "mbed.h" |
YSB | 0:42a334c405de | 8 | |
YSB | 0:42a334c405de | 9 | class GPS : public Serial { |
YSB | 0:42a334c405de | 10 | public: |
YSB | 0:42a334c405de | 11 | GPS(PinName tx,PinName rx); |
YSB | 0:42a334c405de | 12 | char* get_time(); |
YSB | 0:42a334c405de | 13 | float get_latitude(); |
YSB | 0:42a334c405de | 14 | char* get_str_latitude(); |
YSB | 0:42a334c405de | 15 | float get_longitude(); |
YSB | 0:42a334c405de | 16 | char* get_str_longitude(); |
YSB | 0:42a334c405de | 17 | char get_states(); |
YSB | 0:42a334c405de | 18 | float get_speed(); |
YSB | 0:42a334c405de | 19 | |
YSB | 0:42a334c405de | 20 | private: |
YSB | 0:42a334c405de | 21 | |
YSB | 0:42a334c405de | 22 | char GPSdata[1000]; //gps_data_buffer |
YSB | 0:42a334c405de | 23 | char GPGGA[100];//GPGGA_data |
YSB | 0:42a334c405de | 24 | char GPRMC[100];//GPRMC_data |
YSB | 0:42a334c405de | 25 | char time_str[8]; |
YSB | 0:42a334c405de | 26 | char latitude_str[9]; |
YSB | 0:42a334c405de | 27 | float latitude; |
YSB | 0:42a334c405de | 28 | char longitude_str[10]; |
YSB | 0:42a334c405de | 29 | float longitude; |
YSB | 0:42a334c405de | 30 | char states; |
YSB | 0:42a334c405de | 31 | char number_of_satelite; |
YSB | 0:42a334c405de | 32 | char speed_str[5]; |
YSB | 0:42a334c405de | 33 | float speed; |
YSB | 0:42a334c405de | 34 | |
YSB | 0:42a334c405de | 35 | int flg,count;//for rx_func() |
YSB | 0:42a334c405de | 36 | |
YSB | 0:42a334c405de | 37 | void rxHandler(void); |
YSB | 0:42a334c405de | 38 | void update_infomation(); |
YSB | 0:42a334c405de | 39 | void get_GGA_RMC(char* str); |
YSB | 0:42a334c405de | 40 | void get_infomation(char* gga,char* rmc); |
YSB | 0:42a334c405de | 41 | |
YSB | 0:42a334c405de | 42 | Ticker T; |
YSB | 0:42a334c405de | 43 | }; |
YSB | 0:42a334c405de | 44 | |
YSB | 0:42a334c405de | 45 | #endif |
YSB | 0:42a334c405de | 46 |