Library for the EM-406 GPS module
Fork of GPS by
GPS.h@1:455c3e604c92, 2013-03-30 (annotated)
- Committer:
- szabolev
- Date:
- Sat Mar 30 08:11:26 2013 +0000
- Revision:
- 1:455c3e604c92
- Parent:
- 0:15611c7938a3
- Child:
- 2:4ebd0e486b5a
?desapa els? m?k?d? GPS programja
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 | 1:455c3e604c92 | 17 | float longitude,latitude,date,time,speed,altitude,long_masodperc,lati_masodperc; |
szabolev | 1:455c3e604c92 | 18 | int ev,ho,nap,ora,perc,masodperc,long_fok,long_perc,lati_fok,lati_perc; |
szabolev | 1:455c3e604c92 | 19 | char ns,ew,status,fok_jel; |
simon | 0:15611c7938a3 | 20 | |
simon | 0:15611c7938a3 | 21 | private: |
simon | 0:15611c7938a3 | 22 | void getline(); |
szabolev | 1:455c3e604c92 | 23 | int elso2(float d); |
szabolev | 1:455c3e604c92 | 24 | int kozepso2(float d); |
szabolev | 1:455c3e604c92 | 25 | int utolso2(float d); |
szabolev | 1:455c3e604c92 | 26 | int fok_szamol(float f); |
szabolev | 1:455c3e604c92 | 27 | int perc_szamol(float f); |
szabolev | 1:455c3e604c92 | 28 | float masodperc_szamol(float f); |
szabolev | 1:455c3e604c92 | 29 | void nincs_adat(); |
szabolev | 1:455c3e604c92 | 30 | void fokpercmasodperc(); |
szabolev | 1:455c3e604c92 | 31 | |
simon | 0:15611c7938a3 | 32 | Serial _gps; |
simon | 0:15611c7938a3 | 33 | char msg[256]; |
simon | 0:15611c7938a3 | 34 | |
simon | 0:15611c7938a3 | 35 | }; |
simon | 0:15611c7938a3 | 36 | |
simon | 0:15611c7938a3 | 37 | #endif |