acquisition sur carte sd

Dependencies:   SDFileSystem mbed

Fork of SDFileSystem_HelloWorld by mbed official

Files at this revision

API Documentation at this revision

Comitter:
Asoumy
Date:
Wed Nov 23 23:05:15 2016 +0000
Parent:
0:bdbd3d6fc5d5
Commit message:
acquisition sur carte sd

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
diff -r bdbd3d6fc5d5 -r baa16fd2dbb4 SDFileSystem.lib
--- a/SDFileSystem.lib	Fri Dec 07 11:25:01 2012 +0000
+++ b/SDFileSystem.lib	Wed Nov 23 23:05:15 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/SDFileSystem/#c8f66dc765d4
+http://mbed.org/users/mbed_official/code/SDFileSystem/#7b35d1709458
diff -r bdbd3d6fc5d5 -r baa16fd2dbb4 main.cpp
--- a/main.cpp	Fri Dec 07 11:25:01 2012 +0000
+++ b/main.cpp	Wed Nov 23 23:05:15 2016 +0000
@@ -1,19 +1,31 @@
 #include "mbed.h"
 #include "SDFileSystem.h"
  
-SDFileSystem sd(p5, p6, p7, p8, "sd"); // the pinout on the mbed Cool Components workshop board
+SDFileSystem sd(D11,D12,D13 , D3, "sd"); // the pinout on the mbed Cool Components workshop board
  
 int main() {
-    printf("Hello World!\n");   
+    
+    AnalogIn Vpan(A0);
+    AnalogIn Ipan(A1);
+    AnalogIn Tpan(A2);
+    AnalogIn Irr(A3);
+    AnalogIn Vbat(A4);
+    AnalogIn Ibat(A5);
+    printf("debut d'acquisition!\n");   
  
     mkdir("/sd/mydir", 0777);
     
-    FILE *fp = fopen("/sd/mydir/sdtest.txt", "w");
+    FILE *fp = fopen("/sd/mydir/Aquisition panneau.txt", "w");
     if(fp == NULL) {
         error("Could not open file for write\n");
     }
-    fprintf(fp, "Hello fun SD Card World!");
+    fprintf(fp,"valeur d'irradiation %f",Vpan.read()*3.3);
+    fprintf(fp," valeur tension panneau %f",Ipan.read()*3.3);
+    fprintf(fp," valeur temperature panneau %f",Tpan.read()*3.3);
+    fprintf(fp," valeur irradiation panneau %f",Irr.read()*3.3);
+    fprintf(fp," valeur tension batterie %f",Vbat.read()*3.3);
+    fprintf(fp," valeur courant batterie %f",Ibat.read()*3.3);
     fclose(fp); 
  
-    printf("Goodbye World!\n");
+    printf("acquisition reussi!\n");
 }
diff -r bdbd3d6fc5d5 -r baa16fd2dbb4 mbed.bld
--- a/mbed.bld	Fri Dec 07 11:25:01 2012 +0000
+++ b/mbed.bld	Wed Nov 23 23:05:15 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/63cdd78b2dc1
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34
\ No newline at end of file