accelorometer and touch pad
Dependencies: MMA8451Q TSIServo mbed
Fork of FRDM_MMA8451Q by
Revision 9:1f50587ada14, committed 2018-09-27
- Comitter:
- cindyC12
- Date:
- Thu Sep 27 19:30:17 2018 +0000
- Parent:
- 8:0d24df2d4f18
- Child:
- 10:ac7dd2ffbd14
- Commit message:
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Sep 23 04:41:13 2018 +0000 +++ b/main.cpp Thu Sep 27 19:30:17 2018 +0000 @@ -10,16 +10,16 @@ PwmOut g(LED_GREEN); PwmOut b(LED_BLUE); TSISensor tsi; - float readPercentage(); - + while (true) { - r = abs(acc.getAccX()* tsi.readPercentage()); - r = 1.0 - (r*tsi.readPercentage()); - g = abs(acc.getAccY()* tsi.readPercentage()); - g = 1.0 - (g*tsi.readPercentage()); - b = abs(acc.getAccZ()* tsi.readPercentage()); - b = 1.0 - (b*tsi.readPercentage()); + float x, y, z ; + x = abs(acc.getAccX()); + r= 1.0 - (x*tsi. readPercentage()); + y = abs(acc.getAccY()); + g = 1.0 - (y*tsi. readPercentage()); + z = abs(acc.getAccZ()); + b = 1.0 - (z*tsi. readPercentage()); wait(0.1); } }
--- a/mbed.bld Sun Sep 23 04:41:13 2018 +0000 +++ b/mbed.bld Thu Sep 27 19:30:17 2018 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/3d0ef94e36ec \ No newline at end of file +https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187 \ No newline at end of file