![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
`234567890
Revision 0:7a88fb78a840, committed 2018-05-30
- Comitter:
- pratit911
- Date:
- Wed May 30 07:25:55 2018 +0000
- Commit message:
- asdfghjkl
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 7a88fb78a840 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed May 30 07:25:55 2018 +0000 @@ -0,0 +1,37 @@ +#include "mbed.h" +AnalogIn Ain(PTB1); +DigitalOut myled1(LED1); +DigitalOut myled2(LED2); +DigitalOut myled3(LED3); +Serial pc(USBTX,USBRX); +float ADCdata; + +int main() +{ + while(1) + { + + ADCdata=Ain; + pc.printf("%f \n\r",ADCdata); + + + if(ADCdata>0.4) + {myled1=0; + myled2=1; + myled3=1; + } + + else if((ADCdata>0.4 )&& (ADCdata<0.6)) + {myled2=0; + myled1=1; + myled3=1; + } + else + {myled3=0; + myled2=1; + myled1=0; + } + + wait(0.005); + } +} \ No newline at end of file
diff -r 000000000000 -r 7a88fb78a840 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed May 30 07:25:55 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/5aab5a7997ee \ No newline at end of file