always GPS 0

Dependencies:   mbed BMX055_rev2 SDFileSystem

Files at this revision

API Documentation at this revision

Comitter:
MatsumotoKouki
Date:
Sat Aug 29 13:27:41 2020 +0000
Parent:
8:c2812fae50df
Commit message:
when GPS NULL, return 0.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r c2812fae50df -r fc0559c27628 main.cpp
--- a/main.cpp	Sat Aug 29 08:30:57 2020 +0000
+++ b/main.cpp	Sat Aug 29 13:27:41 2020 +0000
@@ -19,7 +19,7 @@
 Timeout t;
 //double a[3],b[3],c[3];
 
-int i,j=0,rlock,mode,north,east;
+int i,j=0,rlock,mode;
 char ns,ew;
 float w_time;//,hokui,tokei;
 float hokui,tokei;
@@ -59,10 +59,11 @@
         bmx.getGyro();//角力加速度の取得
         bmx.getMag();//地磁気の取得
         getGPS(hokui_n,tokei_n);//GPS取得
-        if(hokui_n==NULL){
-            *hokui_n=0;}
-        if(tokei_n==NULL){
-            *tokei_n=0;}
+        
+        if(*hokui_n==NULL){
+            hokui_n=0;}
+        if(*tokei_n==NULL){
+            tokei_n=0;}
         //(fp,"%f,%f,%f,%f,%f,%2.4f,%2.4f,%2.4f,%2.4f,%2.4f,%2.4f\n\r",hokui_n,tokei_n,(bmx.accel[0]/512)*9.8,
         //(bmx.accel[1]/512)*9.8,(bmx.accel[2]/512)*9.8,(bmx.gyroscope[0]*125)/2048,
         //(bmx.gyroscope[1]*125)/2048,(bmx.gyroscope[2]*125)/2048,bmx.magnet[0],bmx.magnet[1],bmx.magnet[2]);
@@ -91,13 +92,16 @@
         uart.printf("%04x%04x%04x",a[0],a[1],a[2]);//加速度の書き出し
         uart.printf("%04x%04x%04x",b[0],b[1],b[2]);//角加速度の書き出し
         
-        north=*(hokui_n) * 1000000;
-        east=*(tokei_n) * 1000000;
         
+        int north=*hokui_n * 1000000;
+        int east=*tokei_n * 1000000;
+        
+        printf("%f",*hokui_n);
         
         uart.printf("%08x%08x",east,north);//GPS書き出し
         
         uart.printf("\r\n");
+        printf("%d%d\n\r",north,east);
 
         wait(0.34);//IM920長距離モードの場合,3パケット/sが理論上最大速度.
         }