Deuxième test
Revision 0:86e1b9cc7b48, committed 2015-03-01
- Comitter:
- Nadia
- Date:
- Sun Mar 01 11:55:35 2015 +0000
- Commit message:
- Reception des trames GPS et l'enregistrer sur cl? USB
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 86e1b9cc7b48 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Mar 01 11:55:35 2015 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" +#include "MSCFileSystem.h" + + +Serial GPS(p13, p14); //Pin13 TX, pin14 RX. +MSCFileSysteme fs("usb"); +DigitalIn bouton(p14); +int main() { + GPS.baud(9600); + unsigned char GPS_DATA; + FILE *FDat = fopen("/usb/FileTtest1.txt", "w"); + + while(bouton==0){ + if(GPS.readable()){ + GPS_DATA=GPS.getc(); + fprintf(FDat,"%lu %2.5f %2.5f %2.5f\r\n",tk1,AccelX,AccelY,AccelZ); + } + } + fclose(FDat); + + +} \ No newline at end of file