test

Dependencies:   mbed MMA8452Q

Fork of HelloWorld by Simon Ford

Revision:
14:f2e0a7c05aa8
Parent:
11:5499b22fd01e
--- a/main.cpp	Wed Aug 30 20:46:59 2017 +0000
+++ b/main.cpp	Thu Aug 31 14:13:00 2017 +0000
@@ -8,7 +8,23 @@
 //I2C comI2C(p9,p10); // sda, scl
 
 int main() {
-    
+     while(1){
+    int nombre = 0;
+    pc.printf("Entrez un nombre de 4 chiffres : ");
+    pc.scanf("%d", &nombre);
+    pc.printf("Votre numero entrez est le : %d", nombre);
+  
+    cs = 0;
+    accel.write((int)nombre);
+    cs = 1;
+    wait(0.2);
+    cs = 0;
+    wait(1);
+    }
+
+}
+
+/*
      float x, y, z ;
  
      MMA8452Q acc(p9,p10,0x1d);
@@ -29,7 +45,8 @@
          cs = 0;
          wait(1); 
         }
-}
+
+*/
 
 
 /* communication SPI