This is my first mbed program for the Kinetis K64F Freedom board.
Dependencies: mbed
Fork of k46f_blink by
Diff: main.cpp
- Revision:
- 0:a4420c888977
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