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:3040c9561484, committed 2016-11-03
- Comitter:
 - Zvonimir_Belic
 - Date:
 - Thu Nov 03 19:41:02 2016 +0000
 - Commit message:
 - Belic lab1
 
Changed in this revision
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file | 
| vjezba3.2.cpp | Show annotated file Show diff for this revision Revisions of this file | 
diff -r 000000000000 -r 3040c9561484 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 03 19:41:02 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9bcdf88f62b0 \ No newline at end of file
diff -r 000000000000 -r 3040c9561484 vjezba3.2.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vjezba3.2.cpp	Thu Nov 03 19:41:02 2016 +0000
@@ -0,0 +1,45 @@
+#include "mbed.h"
+DigitalOut myled1(LED1);
+DigitalOut myled2(LED2);
+DigitalOut myled3(LED3);
+DigitalOut myled4(LED4);
+AnalogIn Ain(p20);
+float ADCdata;
+
+int main() {
+while(1) {
+        ADCdata=Ain;
+        if(ADCdata<=0.2) {
+        myled1=0;
+        myled2=0;
+        myled3=0;
+        myled4=0;
+         }
+         else if ((ADCdata>0.2)&&(ADCdata<=0.4)) {
+        myled1=1;
+        myled2=0;
+        myled3=0;
+        myled4=0;
+        }
+        else if ((ADCdata>0.4)&&(ADCdata<=0.6)) {
+        myled1=1;
+        myled2=1;
+        myled3=0;
+        myled4=0;
+        }
+        else if ((ADCdata>0.6)&&(ADCdata<=0.8)) {
+        myled1=1;
+        myled2=1;
+        myled3=1;
+        myled4=0;
+        }
+        else if ((ADCdata>0.8)&&(ADCdata<=1)) {
+        myled1=1;
+        myled2=1;
+        myled3=1;
+        myled4=1;
+        
+        }
+        }
+        }
+        
\ No newline at end of file