Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:8425c3fba1c3, committed 2017-07-15
- Comitter:
- mikawataru
- Date:
- Sat Jul 15 15:08:02 2017 +0000
- Parent:
- 0:8c134f1c71f2
- Child:
- 2:482c199ca6de
- Commit message:
- Library for GPS
Changed in this revision
| GPS.cpp | Show annotated file Show diff for this revision Revisions of this file |
| GPS.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/GPS.cpp Fri Jul 14 18:09:46 2017 +0000
+++ b/GPS.cpp Sat Jul 15 15:08:02 2017 +0000
@@ -2,6 +2,28 @@
#include "string.h"
#include "GPS.h"
+GPS::GPS(PinName tx, PinName rx) : gps(tx,rx){
+ gps.baud(115200);
+ gps.printf("$PMTK251,9600*17\r\n");
+ wait(0.5);
+ gps.baud(9600);
+ gps.printf("$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n");
+ wait(0.5);
+};
+
+void GPS::rateUP(){
+ gps.baud(9600);
+ gps.printf("$PMTK251,115200*1F\r\n");
+ wait(0.5);
+ gps.baud(115200);
+ gps.printf("$PMTK220,100*2F\r\n");
+ wait(0.5);
+ gps.printf("$PMTK300,00,0,0,0,0*2C\r\n");
+ wait(0.5);
+ gps.printf("$PMTK251,115200*1F\r\n");
+}
+
+
void GPS::getGPS(){
gps_data[cnt_gps] = gps.getc();
--- a/GPS.h Fri Jul 14 18:09:46 2017 +0000
+++ b/GPS.h Sat Jul 15 15:08:02 2017 +0000
@@ -10,9 +10,8 @@
int cnt_gps;
public:
Serial *debug;
- GPS(PinName tx, PinName rx) : gps(tx,rx){
- gps.baud(9600);
- };
+ GPS(PinName tx, PinName rx);
+ void rateUP();
void getGPS();
void LogStart(PinName tx, PinName rx);
float calcLatitude(float raw_data);