assignment 4 exercise 4
Dependencies: BSP_B-L475E-IOT01 mbed
Revision 3:271d790831c8, committed 2018-11-15
- Comitter:
- mcalzana
- Date:
- Thu Nov 15 13:33:46 2018 +0000
- Parent:
- 2:1f47ee8f7f08
- Commit message:
- blinking
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Nov 12 17:44:48 2018 +0000 +++ b/main.cpp Thu Nov 15 13:33:46 2018 +0000 @@ -27,18 +27,34 @@ //100 of tollerance. if(z > 950 && z < 1050){ + led1 = 0; + led2 = 0; + led3 = 0; + wait(0.5); led1 = 1; led2 = 0; led3 = 0; } else if(y > 950 && y < 1050){ led1 = 0; + led2 = 0; + led3 = 0; + wait(0.5); + led1 = 0; led2 = 1; led3 = 0; }else if(x > 950 && x < 1050){ led1 = 0; led2 = 0; + led3 = 0; + wait(0.5); + led1 = 0; + led2 = 0; led3 = 1; }else{ + led1 = 0; + led2 = 0; + led3 = 0; + wait(0.5); led1 = 1; led2 = 1; led3 = 1; @@ -48,7 +64,6 @@ printf("\nACCELERO_X = %d\n", x); printf("ACCELERO_Y = %d\n", y); printf("ACCELERO_Z = %d\n", z); - wait(0.3); } }