Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.
Dependencies: Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo
GPS.h
00001 // For SiRF III 00002 00003 #ifndef __GPS_H 00004 #define __GPS_H 00005 00006 /** GPS interface abstraction library */ 00007 00008 #include "mbed.h" 00009 #include "TinyGPS.h" 00010 #include "GeoPosition.h" 00011 00012 #define SIRF 1 00013 #define MTK 2 00014 #define VENUS 3 00015 00016 class GPS { 00017 public: 00018 GPS(PinName tx, PinName rx, int type); 00019 void setType(int type); 00020 void setBaud(int baud); 00021 void setUpdateRate(int rate); 00022 void setNmeaMessages(bool gga, bool gsa, bool gsv, bool gll, bool rmc, bool vtg); 00023 void gsvMessage(bool enable); 00024 void gsaMessage(bool enable); 00025 void process(GeoPosition &here, char *date, char *time); 00026 void init(void); 00027 void gpsStartCapture(void); 00028 void gpsStopCapture(void); 00029 void recv(void); 00030 int year; // gps date variables 00031 byte month; 00032 byte day; 00033 byte hour; 00034 byte minute; 00035 byte second; 00036 byte hundredths; 00037 float hdop; // gps horizontal dilution of precision 00038 Serial serial; 00039 TinyGPS nmea; 00040 private: 00041 PinName _rx; 00042 int _type; // type of GPS device 00043 }; 00044 00045 #endif
Generated on Tue Jul 12 2022 14:09:25 by 1.7.2