2017年伊豆大島共同打ち上げ実験用電装モジュール搭載GPS測位プログラム

Dependents:   Hybrid_interruptGPS Hybrid_main_FirstEdtion rocket_logger_sinkan2018_v1 HYBRYD2018_IZU_ROCKET ... more

Revision:
1:57eeee14dd31
Parent:
0:74d8e952a3bd
Child:
2:7be89bab6db9
--- a/GPS_interrupt.h	Mon Jan 02 00:40:46 2017 +0000
+++ b/GPS_interrupt.h	Mon Jan 02 01:05:31 2017 +0000
@@ -1,6 +1,10 @@
 /*=============================================================================
-*   GPS_interrupt.lib ver 1.0.3
+*   GPS_interrupt.lib ver 1.0.5
 *   
+*   Each palameters are not stable because they can be changed unexpectedly.
+*   Therefor, you should use the funtions which have return value.
+*   Then, you must not substitute any value for those palameters.
+*
 *=============================================================================*/
 #ifndef GPS_INTERRUPT_H_
 #define GPS_INTERRUPT_H_
@@ -16,9 +20,8 @@
         void initialize();//初期化関数
         void gps_auto_receive();
         bool processGPS(char *line);
-      
         
-    public:
+    private:
         static double latitude;
         static double longitude;
         static int year;
@@ -36,6 +39,7 @@
         static char gps_buffer_A[128];
         static char gps_buffer_B[128];
         static char *gps_read_buffer;
+    public:
         static bool gps_readable;
     private:
         RawSerial *gps;
@@ -97,5 +101,34 @@
             _utc[5] = (int)seconds;
         }
 };
+/////////////////
+/////sample//////
+/////////////////
+/*
+#include "mbed.h"
+#include "GPS_interrupt.h"
+Serial pc(USBTX, USBRX);
+RawSerial mygps(p9, p10);
 
+GPS_interrupt gps(&mygps, 9600);
+
+int main() {
+    
+    pc.baud(115200);
+    mygps.baud(9600);
+    
+    pc.printf("%d Hz\r\n", SystemCoreClock );
+    
+    wait(3.0);
+    while(1){
+            double xy[2] = {0};
+            float utc[6] = {0};
+            gps.getPosition(xy);
+            gps.getUTC(utc);
+            pc.printf("%d 年 %d 月 %d 日 %d 時 %d 分 %02.2f 秒 ",(int)utc[0],(int)utc[1], (int)utc[2], (int)utc[3], (int)utc[4] ,utc[5]); 
+            pc.printf("lon %f\tlat %f\r\n",xy[0], xy[1]);
+            wait(0.10);
+    }
+}
+*/
 #endif
\ No newline at end of file