Divide the slider into four areas
Dependents: JeSuisUnGrandHomme
Fork of info1 by
info1.cpp@2:68deb4a53d73, 2015-01-15 (annotated)
- Committer:
- Agachon
- Date:
- Thu Jan 15 10:28:08 2015 +0000
- Revision:
- 2:68deb4a53d73
- Parent:
- 1:6bd5a7965b66
- Child:
- 3:9f876f7e54c3
Modif Fct
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Agachon | 0:432cc3112901 | 1 | #include "mbed.h" |
Agachon | 0:432cc3112901 | 2 | #include "TSISensor.h" |
Agachon | 0:432cc3112901 | 3 | |
Agachon | 0:432cc3112901 | 4 | |
Agachon | 0:432cc3112901 | 5 | TSISensor tsi2; |
Agachon | 0:432cc3112901 | 6 | |
Agachon | 1:6bd5a7965b66 | 7 | void appui_num(int *bp) |
Agachon | 0:432cc3112901 | 8 | { |
Agachon | 0:432cc3112901 | 9 | if (tsi2.readPercentage()>0) |
Agachon | 1:6bd5a7965b66 | 10 | *bp=1; |
Agachon | 0:432cc3112901 | 11 | else |
Agachon | 1:6bd5a7965b66 | 12 | *bp=0; |
Agachon | 0:432cc3112901 | 13 | } |
Agachon | 0:432cc3112901 | 14 | |
Agachon | 1:6bd5a7965b66 | 15 | void appui_ana (int *bp1,int *bp2,float seuil) |
Agachon | 0:432cc3112901 | 16 | { |
Agachon | 2:68deb4a53d73 | 17 | |
Agachon | 2:68deb4a53d73 | 18 | |
Agachon | 1:6bd5a7965b66 | 19 | if (tsi2.readPercentage()>0 && tsi2.readPercentage()<seuil) |
Agachon | 0:432cc3112901 | 20 | { |
Agachon | 1:6bd5a7965b66 | 21 | *bp1=1; |
Agachon | 1:6bd5a7965b66 | 22 | *bp2=0; |
Agachon | 0:432cc3112901 | 23 | } |
Agachon | 0:432cc3112901 | 24 | |
Agachon | 2:68deb4a53d73 | 25 | else if (tsi2.readPercentage()>=seuil && tsi2.readPercentage()<=1) |
Agachon | 0:432cc3112901 | 26 | { |
Agachon | 1:6bd5a7965b66 | 27 | *bp1=0; |
Agachon | 1:6bd5a7965b66 | 28 | *bp2=1; |
Agachon | 0:432cc3112901 | 29 | } |
Agachon | 2:68deb4a53d73 | 30 | else |
Agachon | 2:68deb4a53d73 | 31 | { |
Agachon | 2:68deb4a53d73 | 32 | *bp1=0; |
Agachon | 2:68deb4a53d73 | 33 | *bp2=0; |
Agachon | 2:68deb4a53d73 | 34 | } |
Agachon | 1:6bd5a7965b66 | 35 | } |