Divide the slider into four areas
Dependents: JeSuisUnGrandHomme
Fork of info1 by
Diff: info1.cpp
- Revision:
- 1:6bd5a7965b66
- Parent:
- 0:432cc3112901
- Child:
- 2:68deb4a53d73
--- a/info1.cpp Tue Dec 16 12:25:56 2014 +0000 +++ b/info1.cpp Tue Jan 13 08:03:57 2015 +0000 @@ -4,33 +4,25 @@ TSISensor tsi2; - -int appui(void) +void appui_num(int *bp) { if (tsi2.readPercentage()>0) - return 1; + *bp=1; else - return 0; + *bp=0; } -float appui_fct(float seuil) +void appui_ana (int *bp1,int *bp2,float seuil) { - if (seuil==0) + if (tsi2.readPercentage()>0 && tsi2.readPercentage()<seuil) { - if (tsi2.readPercentage()>0) - return 1; - else - return 0; + *bp1=1; + *bp2=0; } - else if (seuil>0 && seuil <=1) + if (tsi2.readPercentage()>=seuil && tsi2.readPercentage()<=1) { - return tsi2.readPercentage(); + *bp1=0; + *bp2=1; } - - else - { - return -1; - } - -} +}