accelerometer trial
Dependencies: mbed C12832 MMA7660 USBDevice
Revision 26:f1a0d62af7f9, committed 2019-10-30
- Comitter:
- knasp
- Date:
- Wed Oct 30 20:06:29 2019 +0000
- Parent:
- 25:f8db641d33ab
- Commit message:
- minor changes 2
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r f8db641d33ab -r f1a0d62af7f9 main.cpp --- a/main.cpp Wed Oct 30 19:39:57 2019 +0000 +++ b/main.cpp Wed Oct 30 20:06:29 2019 +0000 @@ -41,6 +41,7 @@ led1=0; led3=0; led4=1; + } else if (myOrientation == MMA7660::Down) { LCD.printf("LEFT"); @@ -49,6 +50,7 @@ led1=0; led2=1; led4=0; + } else if (myOrientation == MMA7660::Left) { LCD.printf("Up"); @@ -57,6 +59,7 @@ led3=0; led2=0; led4=0; + } else if (myOrientation == MMA7660::Right) { LCD.printf("Down"); @@ -66,8 +69,6 @@ led3=1; led2=0; - - } else if (myOrientation == MMA7660::Unknown) { @@ -78,6 +79,7 @@ } else if ((!Switch1) && (!Switch2)){ //when both switches are off standby mode is on (all leds are on) + led3=1; led1=1; led2=1; @@ -119,7 +121,6 @@ led3=1; led2=0; - } @@ -133,7 +134,6 @@ else if ((Switch1) && (Switch2)){ //when both switches are on the arrows are imputed - // A if (myOrientation == MMA7660::Up) { //if the orientation is up LCD.printf("Right"); //print "left" on LCD (due to orientation of the accelerometer on the limb, the directions are changed) @@ -142,6 +142,7 @@ led1=0; //led off led3=0; //led off led4=1; //led on + } else if (myOrientation == MMA7660::Down) { LCD.printf("Left"); @@ -150,6 +151,7 @@ led1=0; led2=1; led4=0; + } else if (myOrientation == MMA7660::Left) { LCD.printf("UP"); @@ -158,6 +160,7 @@ led3=0; led2=0; led4=0; + } else if (myOrientation == MMA7660::Right) { LCD.printf("DOWN"); @@ -167,7 +170,6 @@ led3=1; led2=0; - } else if (myOrientation == MMA7660::Unknown) { LCD.printf("Don't Know");