FRDM-K64 GPIO basic demo

Dependencies:   mbed

Revision:
0:d2b14aa36c71
diff -r 000000000000 -r d2b14aa36c71 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jul 09 19:30:06 2014 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+
+//Delay declared in seconds
+
+/*GPIO declaration*/
+DigitalOut Red(LED1);         
+DigitalOut Green(LED2);
+DigitalOut Blue(LED3);
+DigitalIn sw2(SW2);
+
+
+int main() 
+{
+    /*Leds OFF*/
+    Red=1;
+    Green=1;
+    Blue=1;
+    
+    while(1)
+    {
+        if(sw2==0) 
+        {
+            Red = 0;
+            wait(.2);
+            Red = 1;
+            wait(1);        
+            
+            Green=0;
+            wait(.2);
+            Green=1;
+            wait(1);
+            
+            Blue=0;
+            wait(.2);
+            Blue=1;
+            wait(1);
+        }
+    }
+}
+   
\ No newline at end of file