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.
Dependencies: SDFileSystem mbed
Revision 0:2a7418242b56, committed 2016-04-23
- Comitter:
- maxlh23
- Date:
- Sat Apr 23 07:21:51 2016 +0000
- Commit message:
- Enregistrement des infos du GPS sur la carte SD
Changed in this revision
diff -r 000000000000 -r 2a7418242b56 SDFileSystem.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SDFileSystem.lib Sat Apr 23 07:21:51 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/neilt6/code/SDFileSystem/#6bb3c1987511
diff -r 000000000000 -r 2a7418242b56 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Apr 23 07:21:51 2016 +0000 @@ -0,0 +1,43 @@ +#include "mbed.h" +#include "SDFileSystem.h" + +SDFileSystem sd(PTE3, PTE1, PTE2, PTE4, "card"); // the pinout on the mbed Cool Components workshop board +Serial pc(USBTX, USBRX); // tx, rx +Serial gps(D1, D0); // tx, rx +DigitalOut led1(LED1); +InterruptIn button(PTA4); + +FILE *fp; +int run =1; + +void callback() { + char s = gps.getc(); + fprintf(fp, &s); + //pc.printf(&s); a enlever si on veut voir les infos du gps en continu sur le terminal +} +void stop() { + run =0; +} +int main() { + + pc.printf("Initialized recording\n"); + gps.baud(9600); + pc.baud(9600); + mkdir("/card/gps_tracking", 0777); + + fp = fopen("/card/gps_tracking/sdfile.txt", "w"); + if(fp == NULL) { + error("Could not open file for write\n"); + } + gps.attach(&callback); + pc.attach(&stop); + button.rise(&stop); + + while(run==1) { + led1 = !led1; + wait(0.5); + } + fclose(fp); + + pc.printf("Recording finished.\n"); +}
diff -r 000000000000 -r 2a7418242b56 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Apr 23 07:21:51 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/082adc85693f \ No newline at end of file