Merging-Sensors

Dependencies:   mbed X_NUCLEO_IKS01A2

Files at this revision

API Documentation at this revision

Comitter:
sathoshkumar
Date:
Wed May 08 19:35:06 2019 +0000
Parent:
4:3e6560c38374
Commit message:
Tilt sensor implementation with angle

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed May 08 19:31:09 2019 +0000
+++ b/main.cpp	Wed May 08 19:35:06 2019 +0000
@@ -235,13 +235,14 @@
         } */
         
     //Condition for right tilt check            
-    if (axes[2] < 30)
+    if (axes[1] <= -350)
         printf("Message: Board is tilted on the Left side\n\r");
     
     //Condition for right tilt check
-    if (axes[2] >= 200)
+    if (axes[1] >= -180)
         printf("Message: Board is tilted on the Right side\n\r");
-            
+           
+    wait(0.5); 
         
     }