S-240の電装班 GPSロガーのTP用のプログラム。機体に搭載する際は、LPC1114FN28に移植することを推奨。

Dependencies:   SDFileSystem mbed

Fork of mbed_GPS_TP by Atsumi Toda

Files at this revision

API Documentation at this revision

Comitter:
Joeatsumi
Date:
Mon Sep 11 01:02:14 2017 +0000
Parent:
0:7fe771d8b39a
Commit message:
?????????????????????

Changed in this revision

SDFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SDFileSystem.lib	Mon Sep 11 01:02:14 2017 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/mbed_official/code/SDFileSystem/#8db0d3b02cec
--- a/main.cpp	Sun Sep 03 11:54:59 2017 +0000
+++ b/main.cpp	Mon Sep 11 01:02:14 2017 +0000
@@ -1,12 +1,16 @@
 //LPC1768での作動を確認。
 #include "mbed.h"
+#include "SDFileSystem.h"
+
 DigitalOut led(LED1);
-LocalFileSystem local("local");
+//LocalFileSystem local("local");
+SDFileSystem sd(p5, p6, p7, p8, "sd");
 
 //機体に搭載する際には、LPC1768ではなく、LPC1114を使うと思うので、
 //LocalFileSystem ではなく、sdfilesystemを使うといいかも。
 
 Serial gps(p9,p10);//9,10ピンをGPSの送受信に用いる。
+Serial pc(USBTX,USBRX);
 
 int main(){
        
@@ -23,6 +27,7 @@
         
         rcv[count]=gps.getc();
         
+        
         if(rcv[count]=='$'){//$という文字を受信したら、
             rcv[0]='$';
             count=1;
@@ -30,13 +35,14 @@
             if(rcv[count-1]=='\r'&&rcv[count]=='\n'){
                 rcv[count+1]='\0';
                 
-                if(memcmp(rcv, "$GPRMC",6) == 0) {//$GPRMCという文字を10回取得すると記録する。
+                if(memcmp(rcv, "$GPRMC",6) == 0) {//$GPRMCという文字を1回取得すると記録する。
                          
-                         if(log_count >= 10) {
+                         if(log_count >= 1) {
                           
                           log_count=0;                 
-                            led=1;                                  
-                            fp=fopen("/local/nmea.log","a");
+                            led=1;          
+                            mkdir("/sd/mydir", 0777);                        
+                            fp=fopen("/sd/mydir/nmea.log","a");
                                 if(fp != NULL){
                                 fprintf(fp,"%s",rcv);
                                 fclose(fp);                        
--- a/mbed.bld	Sun Sep 03 11:54:59 2017 +0000
+++ b/mbed.bld	Mon Sep 11 01:02:14 2017 +0000
@@ -1,1 +1,1 @@
-https://mbed.org/users/mbed_official/code/mbed/builds/fd96258d940d
\ No newline at end of file
+https://mbed.org/users/mbed_official/code/mbed/builds/e1686b8d5b90
\ No newline at end of file