Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
mdidrich
Date:
Tue Oct 03 12:32:42 2017 +0000
Commit message:
1

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 e03b3d7ec8d8 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Oct 03 12:32:42 2017 +0000
@@ -0,0 +1,50 @@
+#include "mbed.h"
+
+
+BusOut ledNS(p5, p6, p7);  // Grønn, Gul , Rød
+BusOut ledOV(p8, p9, p10); // Grønn, Gul , Rød
+DigitalIn natt(p20);
+
+int lysNS[8] = {4,4,4,6,1,2,4,4};
+int lysOV[8] = {1,2,4,4,4,4,4,6};
+float ventetid[8] = {5,2,1,0.5,5,2,1,0.5};
+    
+int index = 0;
+int bryter;
+
+int main() {
+while(1){
+    bryter = natt;
+    if (bryter == 0){
+        for(index = 0; index < 8; index++)
+            {
+            ledNS = lysNS[index];
+            ledOV = lysOV[index];
+            wait(ventetid[index]);
+            bryter = natt;
+                if(bryter == 1)
+                {
+                    index = 0;
+                    break;
+                }
+            }//for
+        }//if
+        else{
+            ledNS = ledOV =  2;
+            wait(1);
+            ledNS = ledOV = 0;
+            wait(1);
+            bryter = natt;
+                if(bryter == 0){
+                    index = 0;
+                    }
+            }//else
+    }//while
+}//main
+
+
+
+
+
+
+
diff -r 000000000000 -r e03b3d7ec8d8 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Oct 03 12:32:42 2017 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/mbed/builds/235179ab3f27
\ No newline at end of file