LED blink example with different type of initializing

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
kumaresh
Date:
Fri Apr 17 12:33:12 2015 +0000
Commit message:
LED blink example with different initializing example

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 7bf4747cc128 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Apr 17 12:33:12 2015 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+
+// different type of initializing LED in NUCLEO board
+
+DigitalOut myled1(LED1); //
+DigitalOut myled2(PA_5); // LED connected to pin PA5 in board
+DigitalOut myled3(D13); // same as PA5. D13 arduino pin format
+
+
+int main() {
+    while(1) {
+        myled1 = 1; // LED is ON
+        wait(0.2); // 200 ms        delay function. 1 is equal to one second
+        
+        myled2 = 0; // LED is OFF
+        wait(1); // 1 sec
+        
+        myled3 = 1; // LED is ON
+        wait(0.8); // 800 ms
+        
+        myled1 = 0; // LED is OFF
+        wait(1); // 1 sec
+    }
+}
diff -r 000000000000 -r 7bf4747cc128 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Apr 17 12:33:12 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/433970e64889
\ No newline at end of file