This is my first mbed program for the Kinetis K64F Freedom board.

Dependencies:   mbed

Fork of k46f_blink by Steven Cheldelin

Files at this revision

API Documentation at this revision

Comitter:
rcflyair
Date:
Thu May 08 15:09:20 2014 +0000
Commit message:
My first mbed program for the Kinetis K64F Freedom board.

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 a4420c888977 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu May 08 15:09:20 2014 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+
+int main() {
+    DigitalOut RLED(PTB22);
+    DigitalOut GLED(PTE26);
+    DigitalOut BLED(PTB21);
+    enum color {none, red, green, blue};
+    color state = none;
+
+    while (true) {
+        switch (state) {
+            case none :
+                RLED = 1;
+                GLED = 1;
+                BLED = 1;
+                state = red;
+                break;
+            case red :
+                RLED = 0;
+                GLED = 1;
+                BLED = 1;
+                state = green;
+                break;
+            case green :
+                RLED = 1;
+                GLED = 0;
+                BLED = 1;
+                state = blue;
+                break;
+            case blue :
+                RLED = 1;
+                GLED = 1;
+                BLED = 0;
+                state = red;
+                break;
+        }
+    wait(1);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r a4420c888977 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu May 08 15:09:20 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e
\ No newline at end of file