Projet S5 Info / Mbed 2 deprecated projet_accel

Dependencies:   mbed-rtos mbed

Fork of projet_accel by APP Team

Revision:
0:1e7ffdb6d1db
Child:
1:761ea6f346ab
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/collector.cpp	Thu Mar 20 13:16:01 2014 +0000
@@ -0,0 +1,37 @@
+#include "main.h"
+
+DigitalIn bouton(p7); 
+int x,y,z,c; 
+bool release;
+std::vector<int> x_array;
+std::vector<int> y_array;
+std::vector<int> z_array;
+
+Serial pc(USBTX, USBRX);    // PC serial communication 
+
+void collector_thread(void const *args)
+{
+        while(1)
+        {
+            if(bouton)
+            {
+            
+            release = true;
+            x_array[c] = getAccelValue(OUT_X_MSB); 
+            y_array[c]= getAccelValue(OUT_Y_MSB); 
+            z_array[c]= getAccelValue(OUT_Z_MSB);
+            c++;
+            }
+          else{
+              if(release == true)
+                 {
+                  
+                  pc.printf("bouton release");
+                    
+                  pc.printf("d% ", x_array[0]);
+                  release = false;
+                  c = 0;
+                 }
+              }
+      }
+}