Library for the EM-406 GPS module
Fork of GPS by
GPS.h@2:4ebd0e486b5a, 2013-08-19 (annotated)
- Committer:
- szabolev
- Date:
- Mon Aug 19 08:51:14 2013 +0000
- Revision:
- 2:4ebd0e486b5a
- Parent:
- 1:455c3e604c92
init
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
simon | 0:15611c7938a3 | 1 | #include "mbed.h" |
simon | 0:15611c7938a3 | 2 | |
simon | 0:15611c7938a3 | 3 | #ifndef MBED_GPS_H |
szabolev | 1:455c3e604c92 | 4 | |
simon | 0:15611c7938a3 | 5 | #define MBED_GPS_H |
simon | 0:15611c7938a3 | 6 | |
simon | 0:15611c7938a3 | 7 | /** A GPS interface for reading from a Globalsat EM-406 GPS Module */ |
simon | 0:15611c7938a3 | 8 | class GPS { |
simon | 0:15611c7938a3 | 9 | public: |
szabolev | 1:455c3e604c92 | 10 | /* Create the GPS interface, connected to the specified serial port*/ |
szabolev | 1:455c3e604c92 | 11 | GPS(PinName tx, PinName rx); |
szabolev | 1:455c3e604c92 | 12 | /* |
szabolev | 1:455c3e604c92 | 13 | Sample the incoming GPS data, returning whether there is a lock |
szabolev | 1:455c3e604c92 | 14 | @return 1 if there was a lock when the sample was taken (and therefore .longitude and .latitude are valid), else 0 |
simon | 0:15611c7938a3 | 15 | */ |
simon | 0:15611c7938a3 | 16 | int sample(); |
szabolev | 2:4ebd0e486b5a | 17 | float old_sz,old_h,tav,vit,start,delta_t; |
szabolev | 2:4ebd0e486b5a | 18 | struct data { |
szabolev | 2:4ebd0e486b5a | 19 | int ora,perc,masodperc; |
szabolev | 2:4ebd0e486b5a | 20 | char flag; |
szabolev | 2:4ebd0e486b5a | 21 | float szel; |
szabolev | 2:4ebd0e486b5a | 22 | char szb; |
szabolev | 2:4ebd0e486b5a | 23 | float hossz; |
szabolev | 2:4ebd0e486b5a | 24 | char hb; |
szabolev | 2:4ebd0e486b5a | 25 | float sebesseg; |
szabolev | 2:4ebd0e486b5a | 26 | float magassag; |
szabolev | 2:4ebd0e486b5a | 27 | int ev,honap,nap; |
szabolev | 2:4ebd0e486b5a | 28 | } poz; |
szabolev | 2:4ebd0e486b5a | 29 | float tavolsag(float h1,float sz1,float h2,float sz2); |
simon | 0:15611c7938a3 | 30 | |
simon | 0:15611c7938a3 | 31 | private: |
simon | 0:15611c7938a3 | 32 | void getline(); |
szabolev | 1:455c3e604c92 | 33 | void nincs_adat(); |
szabolev | 1:455c3e604c92 | 34 | |
simon | 0:15611c7938a3 | 35 | Serial _gps; |
simon | 0:15611c7938a3 | 36 | char msg[256]; |
simon | 0:15611c7938a3 | 37 | |
simon | 0:15611c7938a3 | 38 | }; |
simon | 0:15611c7938a3 | 39 | |
simon | 0:15611c7938a3 | 40 | #endif |