![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
tsi name
Revision 0:691801d15035, committed 2018-05-30
- Comitter:
- pratit911
- Date:
- Wed May 30 07:12:53 2018 +0000
- Commit message:
- tsi name
Changed in this revision
diff -r 000000000000 -r 691801d15035 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed May 30 07:12:53 2018 +0000 @@ -0,0 +1,49 @@ +#include "mbed.h" +#include "tsi_sensor.h" +#if defined(TARGET_KL25Z) + #define ELEC0 9 + #define ELEC1 10 +#else + #error TARGET NOT DEFINED +#endif +DigitalOut myled1(LED1); +DigitalOut myled2(LED2); +DigitalOut myled3(LED3); +Serial pc(USBTX, USBRX); +float touch; +int main(void) +{ + TSIAnalogSlider tsi(ELEC1, ELEC0, 75); + + while(true) + { + myled1=1; + myled2=1; + myled3=1; + touch=tsi.readPercentage(); + + + if(touch<0.33 && touch>0) + {myled1=0; + myled2=1; + myled3=1; + pc.printf("PRATIT\n"); + wait(0.1);} + + if(touch>0.33 && touch<0.66) + {myled1=1; + myled2=0; + myled3=1; + pc.printf("NAYAK\n"); + wait(0.1);} + + if(touch>0.66) + {myled1=1; + myled2=1; + myled3=0; + pc.printf("POKHARIPUT\n"); + wait(0.1);} + + wait(0.1); + } +} \ No newline at end of file
diff -r 000000000000 -r 691801d15035 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed May 30 07:12:53 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/5aab5a7997ee \ No newline at end of file
diff -r 000000000000 -r 691801d15035 tsi_sensor.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsi_sensor.lib Wed May 30 07:12:53 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/Kojto/code/tsi_sensor/#976904559b5c