FRDM-K64 GPIO basic demo

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
APanecatl
Date:
Wed Jul 09 19:30:06 2014 +0000
Commit message:
rev 1.0

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 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
diff -r 000000000000 -r d2b14aa36c71 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jul 09 19:30:06 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/024bf7f99721
\ No newline at end of file