oppgave 4 el-pom H15

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
madmonkeyman82
Date:
Sat Feb 20 19:22:31 2016 +0000
Commit message:
first;

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 680d846a6f2f main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Feb 20 19:22:31 2016 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+
+DigitalOut Led1(PA_8);
+DigitalOut Motor(PC_7);
+DigitalIn S1(PB_5);
+
+
+
+int main() {
+    // Init the ticker with the address of the function (toggle_led) to be attached and the interval (100 ms)
+    S1.mode(PullUp);
+    Led1 = 0;
+    Motor = 0;
+    while (true) {
+        
+        if(S1==0)
+        {
+        Led1=1;
+        Motor=1;    
+        }
+        else 
+        {
+        Led1=0;
+        Motor=0;    
+        }
+        // Do other things...
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 680d846a6f2f mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Feb 20 19:22:31 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/252557024ec3
\ No newline at end of file