A test utility for mma8452

Dependencies:   MMA8452 mbed

Files at this revision

API Documentation at this revision

Comitter:
nherriot
Date:
Wed Oct 16 18:55:48 2013 +0000
Parent:
5:34fa5db89a3a
Child:
7:2fa57cf76768
Commit message:
adding method to get control reg 1.

Changed in this revision

MMA8452.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
--- a/MMA8452.lib	Wed Oct 16 16:26:39 2013 +0000
+++ b/MMA8452.lib	Wed Oct 16 18:55:48 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/nherriot/code/MMA8452/#27aa3cd43234
+http://mbed.org/users/nherriot/code/MMA8452/#b3d0abd97e55
--- a/main.cpp	Wed Oct 16 16:26:39 2013 +0000
+++ b/main.cpp	Wed Oct 16 18:55:48 2013 +0000
@@ -54,6 +54,22 @@
     {
         pc.printf("\nFailed to get the device status. The id is set as: 0x%x ", deviceStatus);
     }
+    
+    
+    int ControlRegister(0);
+    if (accelerometer.get_CTRL_Reg1(ControlRegister)==0)
+    {
+        pc.printf("\nGot contents of Control Register1 which is: 0x%x \n", ControlRegister);
+        
+    
+    }
+    else
+    {
+        pc.printf("\nFailed to get the device status. The id is set as: 0x%x ", deviceStatus);
+    }
+    
+      
+    wait(5);
         
     for (int i=0;i<=50;i++)
         {