accelorometer and touch pad

Dependencies:   MMA8451Q TSIServo mbed

Fork of FRDM_MMA8451Q by mbed official

Files at this revision

API Documentation at this revision

Comitter:
cindyC12
Date:
Thu Sep 27 19:43:24 2018 +0000
Parent:
9:1f50587ada14
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Sep 27 19:30:17 2018 +0000
+++ b/main.cpp	Thu Sep 27 19:43:24 2018 +0000
@@ -10,16 +10,16 @@
     PwmOut g(LED_GREEN);
     PwmOut b(LED_BLUE);
      TSISensor tsi;
- 
+     
 
     while (true) {
         float x, y, z ;
         x = abs(acc.getAccX());
-         r= 1.0 - (x*tsi. readPercentage());
+        r= 1.0 - (x*tsi.readPercentage());
         y = abs(acc.getAccY());
-        g = 1.0 - (y*tsi. readPercentage());
+        g = 1.0 - (y*tsi.readPercentage());
         z = abs(acc.getAccZ());
-        b = 1.0 - (z*tsi. readPercentage());
+        b = 1.0 - (z*tsi.readPercentage());
         wait(0.1);
     }
 }