Divide the slider into four areas
Dependents: JeSuisUnGrandHomme
Fork of info1 by
Revision 3:9f876f7e54c3, committed 2015-01-21
- Comitter:
- Ridaz
- Date:
- Wed Jan 21 09:35:50 2015 +0000
- Parent:
- 2:68deb4a53d73
- Commit message:
Changed in this revision
info1.cpp | Show annotated file Show diff for this revision Revisions of this file |
info1.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/info1.cpp Thu Jan 15 10:28:08 2015 +0000 +++ b/info1.cpp Wed Jan 21 09:35:50 2015 +0000 @@ -33,3 +33,45 @@ *bp2=0; } } + +void appui_ana_2 (int *bp1,int *bp2,int *bp3, int *bp4) +{ + float seuil = 0.5; + + if (tsi2.readPercentage()>0 && tsi2.readPercentage()<0.15 ) + { + *bp1=1; + *bp2=0; + *bp3=0; + *bp4=0; + } + + else if (tsi2.readPercentage()>=0.15 && tsi2.readPercentage()<= seuil ) + { + *bp1=0; + *bp2=1; + *bp3=0; + *bp4=0; + } + else if (tsi2.readPercentage()>seuil && tsi2.readPercentage()<= 0.95) + { + *bp1=0; + *bp2=0; + *bp3=1; + *bp4=0; + } + else if (tsi2.readPercentage()>0.95 && tsi2.readPercentage()<= 1) + { + *bp1=0; + *bp2=0; + *bp3=0; + *bp4=1; + } + else + { + *bp1=0; + *bp2=0; + *bp3=0; + *bp4=0; + } +} \ No newline at end of file
--- a/info1.h Thu Jan 15 10:28:08 2015 +0000 +++ b/info1.h Wed Jan 21 09:35:50 2015 +0000 @@ -1,4 +1,6 @@ void appui_num(int *); -void appui_ana (int *,int *,float); \ No newline at end of file +void appui_ana (int *,int *,float); + +void appui_ana_2 (int *,int *,int *, int *); \ No newline at end of file