Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Revision 0:e9ad483dd046, committed 2016-11-03
- Comitter:
- tomislav11
- Date:
- Thu Nov 03 18:21:14 2016 +0000
- Commit message:
- Danas je
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 e9ad483dd046 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 03 18:21:14 2016 +0000 @@ -0,0 +1,50 @@ +#include "mbed.h" + +DigitalOut myled(LED1); +DigitalOut myled1(LED2); +DigitalOut myled2(LED3); +DigitalOut myled3(LED4); + +AnalogIn Ain(p20); +float ADCdata; + +int main() +{ + while(1) { + ADCdata=Ain; + + if(ADCdata<=0.2) { + myled=0; + myled1=0; + myled2=0; + myled3=0; + + + } else if((ADCdata>0.2)&&(ADCdata<=0.4)) { + myled=1; + myled1=0; + myled2=0; + myled3=0; + + + } else if((ADCdata>0.4)&&(ADCdata<=0.6)) { + myled=1; + myled1=1; + myled2=0; + myled3=0; + + } else if((ADCdata>0.6)&&(ADCdata<=0.8)) { + myled=1; + myled1=1; + myled2=1; + myled3=0; + } else if((ADCdata>0.8)&&(ADCdata<=10)) { + myled=1; + myled1=1; + myled2=1; + myled3=1; + } + + + } +}
diff -r 000000000000 -r e9ad483dd046 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 03 18:21:14 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9bcdf88f62b0 \ No newline at end of file