This is a demo program for Input Output on STM32F401RE Board

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
neutron_striker
Date:
Sun Feb 15 19:17:57 2015 +0000
Commit message:
Demo for Input and Output.

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 649cc46c0756 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Feb 15 19:17:57 2015 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+
+DigitalOut myled(D15);
+DigitalIn button(USER_BUTTON);
+DigitalOut led(LED1);
+
+int main() {
+    while(1) {
+    
+    if(button == 1)
+            led = 1;
+    else led = 0;
+    
+        myled = 1; // LED is ON
+        wait(0.05); // 200 ms
+        myled = 0; // LED is OFF
+        wait(1); // 1 sec
+    }
+}
diff -r 000000000000 -r 649cc46c0756 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Feb 15 19:17:57 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e188a91d3eaa
\ No newline at end of file