Pajić Enil Lejla Agić

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
tim008
Date:
Mon Mar 10 09:05:17 2014 +0000
Commit message:
L2-G1-Tim8-Zad3

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 03f37e705af1 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Mar 10 09:05:17 2014 +0000
@@ -0,0 +1,41 @@
+#include "mbed.h"
+
+BusOut KOL(dp16, dp15, dp17, dp18);
+BusIn RED (dp9, dp10, dp11, dp13);
+BusOut l (dp23, dp24, dp25, dp26, dp27, dp5, dp6, dp28);
+DigitalOut e (dp14);
+int Dugme ()
+    {
+        int Z[] = {1, 2, 4, 8};
+        for (int a = 1; a < 5; ++a)
+            {
+                KOL = Z[a - 1];
+                for (int b = 1; b < 5; ++b)
+                    {
+                        if (RED == Z[b-1])
+                            return 1+ 4*(a-1) + (b-1);
+                    }
+                
+            }
+        return 0;
+    }
+int main() {
+    int Z[] = {127, 191, 223, 239, 247, 251, 253, 254};
+    e = 0;
+    l = 1;
+    e = 1;
+    int x = 0;
+    while(1) {
+        e = 1;
+        x = Dugme();
+        e = 0;
+        if (x > 0 && x < 13)
+        {
+            if (x >= 5 && x < 9) x--;
+            if (x >= 9) x -= 2;
+            
+            l = Z[x-1];
+        }
+        wait (0.5);
+    }
+}
diff -r 000000000000 -r 03f37e705af1 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Mar 10 09:05:17 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1
\ No newline at end of file