3K04 Project / Mbed 2 deprecated Pacemaker

Dependencies:   mbed-rtos mbed

Revision:
1:8f545f45d899
Parent:
0:00669618559e
Child:
2:4fb5a8d15f9c
--- a/motion.cpp	Thu Nov 24 16:37:00 2016 +0000
+++ b/motion.cpp	Fri Nov 25 03:44:54 2016 +0000
@@ -20,6 +20,16 @@
     return motion_exceeded_threshold;    
 }
 
+float getAcceleration(){
+    float xAcc, yAcc, zAcc;
+    acc.getX(&xAcc);
+    acc.getY(&yAcc);
+    acc.getZ(&zAcc);
+    float magtd = xAcc*xAcc + yAcc*yAcc + zAcc*zAcc;
+    return magtd;
+}
+    
+
 void resetMotionDetection () {
     motion_exceeded_threshold = 0;
 }