GPS Library for Nucleo
Dependencies: Adafruit_GPS
Fork of MBed_Adafruit-GPS-Library by
GPS_Wrapper.h@3:f2477af055c3, 2015-12-05 (annotated)
- Committer:
- ptcrews
- Date:
- Sat Dec 05 07:30:40 2015 +0000
- Revision:
- 3:f2477af055c3
- Child:
- 5:1249c2cfdede
Full GPS library for the project.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ptcrews | 3:f2477af055c3 | 1 | #include "main.h" |
ptcrews | 3:f2477af055c3 | 2 | #include "MBed_Adafruit_GPS.h" |
ptcrews | 3:f2477af055c3 | 3 | |
ptcrews | 3:f2477af055c3 | 4 | #define REFRESH_TIME 2000 //Refresh time in ms |
ptcrews | 3:f2477af055c3 | 5 | |
ptcrews | 3:f2477af055c3 | 6 | // GPS global variables |
ptcrews | 3:f2477af055c3 | 7 | |
ptcrews | 3:f2477af055c3 | 8 | #ifndef _GPS_WRAPPER_CLASS |
ptcrews | 3:f2477af055c3 | 9 | #define _GPS_WRAPPER_CLASS |
ptcrews | 3:f2477af055c3 | 10 | |
ptcrews | 3:f2477af055c3 | 11 | class GPS_Sensor { |
ptcrews | 3:f2477af055c3 | 12 | public: |
ptcrews | 3:f2477af055c3 | 13 | GPS_Sensor() : gps_Serial(GPS_TX, GPS_RX), myGPS(&gps_Serial), gpsEN(GPS_EN){} |
ptcrews | 3:f2477af055c3 | 14 | void setup(); |
ptcrews | 3:f2477af055c3 | 15 | void read(struct reading& lastReadingBuffer); |
ptcrews | 3:f2477af055c3 | 16 | void turnOff() { gpsEN.write(0); } |
ptcrews | 3:f2477af055c3 | 17 | void turnOn() { gpsEN.write(1); } |
ptcrews | 3:f2477af055c3 | 18 | |
ptcrews | 3:f2477af055c3 | 19 | private: |
ptcrews | 3:f2477af055c3 | 20 | Serial gps_Serial; |
ptcrews | 3:f2477af055c3 | 21 | Adafruit_GPS myGPS; |
ptcrews | 3:f2477af055c3 | 22 | DigitalOut gpsEN; |
ptcrews | 3:f2477af055c3 | 23 | Timer refresh_Timer; |
ptcrews | 3:f2477af055c3 | 24 | }; |
ptcrews | 3:f2477af055c3 | 25 | |
ptcrews | 3:f2477af055c3 | 26 | #endif |