Blinking All Leds using BusOut

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
dwijaybane
Date:
Wed Oct 07 11:42:01 2015 +0000
Parent:
0:f88d2b00a8e8
Commit message:
comments updated

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r f88d2b00a8e8 -r f37612ceda88 main.cpp
--- a/main.cpp	Tue Oct 06 06:09:52 2015 +0000
+++ b/main.cpp	Wed Oct 07 11:42:01 2015 +0000
@@ -1,12 +1,15 @@
-#include "mbed.h"
+#include "mbed.h"   // Basic Library required for onchip peripherals
 
-BusOut myleds(LED1, LED2, LED3, LED4);
+/* Create Objects */
+BusOut myleds(LED1, LED2, LED3, LED4);  // Create a nibble of Digital Outputs named myleds
+                                        // So using single nibble one can easily access all listed bits
 
+/* Main Program */
 int main() {
     while(1) {
-        myleds = 0xF;  
-        wait(0.5);  // 500 ms
-        myleds = 0;
-        wait(0.5);
+        myleds = 0xF;   // Glow All Leds 
+        wait(0.5);      // 500 ms delay
+        myleds = 0;     // Turn off all leds
+        wait(0.5);      // 500 ms delay
     }
 }