UoD_ME21001_Group_2_08 / Mbed 2 deprecated ME21001_Lab03_Exercise_04

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
mridley
Date:
Tue Oct 01 15:11:04 2019 +0000
Commit message:
ex 4

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 e0f971cdb0ae main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Oct 01 15:11:04 2019 +0000
@@ -0,0 +1,14 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);//use on board LED1
+DigitalIn switchstate(p17);// pin17
+
+int main() {
+    while(1) { // repeat indefinetly
+        if (switchstate.read()) //if switch is "HI"
+        myled = 1; //turn LED1 on
+        wait(0.5); //wait 0.5s
+        myled = 0;// turn LED1 off
+        wait(0.5); // wait 0.5s
+    }
+}
diff -r 000000000000 -r e0f971cdb0ae mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Oct 01 15:11:04 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file