SAADI Nadia
/
DataLogger
DataLogger
Revision 0:74c9916708f2, committed 2015-02-22
- Comitter:
- Nadia
- Date:
- Sun Feb 22 10:00:29 2015 +0000
- Commit message:
- First Test Data Loging 22/02/15
Changed in this revision
diff -r 000000000000 -r 74c9916708f2 USBHost.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBHost.lib Sun Feb 22 10:00:29 2015 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/USBHost/#7671b6a8c363
diff -r 000000000000 -r 74c9916708f2 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Feb 22 10:00:29 2015 +0000 @@ -0,0 +1,41 @@ +#include "mbed.h" +#include "USBHostMSD.h" + +DigitalOut led1(LED1); +DigitalOut led2(LED2); + +float AccelX,AccelY,AccelZ; +int Index; +int main() +{ + led1=0; + led2=0; + + AccelX=0.5; + AccelY=0.8; + AccelZ=0.9; + + Index=0; + + USBHostMSD DatLog("usb");// définit l'accès au fichier système + + // Essayer de connecter le périphérique MSD + while(!DatLog.connect()) + { + wait(0.5); + + } + led1=!led1; + + while(1) + { + FILE *FDat = fopen("/usb/FileTtest1.txt", "a");//ajouter un fichier + if(FDat!=NULL) + { + fprintf(FDat, "%d AccelX : %f AccelY : %f AccelZ : %f \r\n", Index++,AccelX,AccelY,AccelZ); + led2=!led2; + } + fclose(FDat); + wait(0.5); + } +} \ No newline at end of file
diff -r 000000000000 -r 74c9916708f2 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Feb 22 10:00:29 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/5e5da4a5990b \ No newline at end of file