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

Dependencies:   mbed

Fork of k46f_blink by Steven Cheldelin

main.cpp

Committer:
rcflyair
Date:
2014-05-08
Revision:
0:a4420c888977

File content as of revision 0:a4420c888977:

#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);
    }
}