MMS8452Q test program

Dependencies:   MMA8452Q mbed

Files at this revision

API Documentation at this revision

Comitter:
Rhyme
Date:
Fri Apr 28 04:10:24 2017 +0000
Parent:
1:3607d35e1740
Commit message:
Format changed to be compatible with CSV

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 3607d35e1740 -r b393024f4293 main.cpp
--- a/main.cpp	Wed Jan 13 23:59:52 2016 +0000
+++ b/main.cpp	Fri Apr 28 04:10:24 2017 +0000
@@ -8,12 +8,15 @@
      float x, y, z ;
 
      MMA8452Q acc(PIN_SDA, PIN_SCL, MMA8452_I2C_ADDRESS);
+     
+     printf("=== test MMA8452Q for %s (%s) ===\n",BOARD_NAME, __DATE__) ;
+     printf(" X,     Y,     Z\n") ;
  
      while (true) {       
          x = acc.getAccX() ;
          y = acc.getAccY() ;
          z = acc.getAccZ() ;
-         printf("X[%.2f] Y[%.2f] Z[%.2f]\n",x, y, z) ;
+         printf("%.2f, %.2f, %.2f\n",x, y, z) ;
          wait(0.1);
     }
 }