sample for GPS (used by nucleo_STM-F303K8)

Dependencies:   mbed

Fork of Nucleo_GPS by Kosuke Furumoto

Files at this revision

API Documentation at this revision

Comitter:
mikawataru
Date:
Sat Jan 28 13:34:26 2017 +0000
Parent:
3:03e5370e74a3
Commit message:
????????????

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sat Jan 28 13:15:00 2017 +0000
+++ b/main.cpp	Sat Jan 28 13:34:26 2017 +0000
@@ -22,7 +22,7 @@
 Serial gps(D1, D0);       // tx, rx
 Serial pc(USBTX, USBRX);    // tx, rx
 int i,rlock,mode;
-char gps_data[256],gps2_data[256];
+char gps_data[256];
 char ns,ew;
 float w_time,hokui,tokei;
 float g_hokui,g_tokei;
@@ -34,6 +34,9 @@
   if( c=='$' || i == 256){
     mode = 0;
     i = 0;
+    for(int j=0; j<256; j++){
+        gps_data[j]=NULL;
+    }
   }
   if(mode==0){
     if((gps_data[i]=c) != '\r'){
@@ -67,7 +70,7 @@
 int main(){
   pc.printf("*** GPS GT-720F ***");
   gps.baud(9600);
-  pc.baud(115200);
+//  pc.baud(115200);
   gps.attach(getGPS,Serial::RxIrq);
   while(1) {}
 }