DataLogger

Dependencies:   USBHost mbed

Files at this revision

API Documentation at this revision

Comitter:
Nadia
Date:
Sun Feb 22 10:00:29 2015 +0000
Commit message:
First Test Data Loging 22/02/15

Changed in this revision

USBHost.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
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