First version of a led light house

Dependencies:   microbit

Files at this revision

API Documentation at this revision

Comitter:
tyynetyyne
Date:
Mon Jul 23 13:56:11 2018 +0000
Commit message:
first version of ledimajakka;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
microbit.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r c78396b3c6b3 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jul 23 13:56:11 2018 +0000
@@ -0,0 +1,27 @@
+
+#include "MicroBit.h"
+
+MicroBit uBit;
+int arvo = 0;
+
+int main()
+{
+    uBit.init();     
+    while (1)
+    {
+        arvo = uBit.io.P1.getAnalogValue();
+        if(arvo <= 550)
+        {
+            uBit.io.P0.setDigitalValue(0); 
+        }
+        else
+        {
+            uBit.io.P0.setDigitalValue(1);
+            uBit.sleep(1000);
+            uBit.io.P0.setDigitalValue(0);
+            uBit.sleep(1000);
+        }
+    }   
+}
+
+
diff -r 000000000000 -r c78396b3c6b3 microbit.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/microbit.lib	Mon Jul 23 13:56:11 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/Lancaster-University/code/microbit/#4b89e7e3494f