Isme LED ka state change karte h touch ke value pe
Fork of FRDM_TSI by
main.cpp@6:283bfb3a10c2, 2016-07-02 (annotated)
- Committer:
- akashlal
- Date:
- Sat Jul 02 07:24:00 2016 +0000
- Revision:
- 6:283bfb3a10c2
- Parent:
- 1:51b1b688179a
na
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 0:0f00f07ebde0 | 1 | #include "mbed.h" |
chris | 1:51b1b688179a | 2 | #include "TSISensor.h" |
emilmont | 0:0f00f07ebde0 | 3 | |
emilmont | 0:0f00f07ebde0 | 4 | int main(void) { |
chris | 1:51b1b688179a | 5 | PwmOut led(LED_GREEN); |
chris | 1:51b1b688179a | 6 | TSISensor tsi; |
emilmont | 0:0f00f07ebde0 | 7 | |
emilmont | 0:0f00f07ebde0 | 8 | while (true) { |
akashlal | 6:283bfb3a10c2 | 9 | if(tsi.readPercentage()<0.5&&tsi.readPercentage()>0.00) |
akashlal | 6:283bfb3a10c2 | 10 | { |
akashlal | 6:283bfb3a10c2 | 11 | led = 1; |
akashlal | 6:283bfb3a10c2 | 12 | } |
akashlal | 6:283bfb3a10c2 | 13 | else if(tsi.readPercentage()>0.5) |
akashlal | 6:283bfb3a10c2 | 14 | { |
akashlal | 6:283bfb3a10c2 | 15 | led = 0; |
akashlal | 6:283bfb3a10c2 | 16 | } |
emilmont | 0:0f00f07ebde0 | 17 | } |
chris | 1:51b1b688179a | 18 | } |