FRDM-KL25z simple tutorial example of controlling the RGB LED to flash different colors, and sending status messages to the host via the pc serial connection. Includes extensive explanatory comments.
Diff: main.cpp
- Revision:
- 2:ca90e565de77
- Parent:
- 1:c07d099d8e31
diff -r c07d099d8e31 -r ca90e565de77 main.cpp --- a/main.cpp Fri Jul 19 02:15:42 2013 +0000 +++ b/main.cpp Fri Jul 19 02:16:18 2013 +0000 @@ -35,7 +35,7 @@ int main() { pc.baud (9600); // Set the baud rate for the serial connection - redLED = 1; // This a common anode RGB LED, with the cathodes connected + redLED = 1; // This a common anode RGB LED, with the anodes connected greenLED = 1; // to 1. Thus, to turn a color off you counterintuitively set blueLED = 1; // it to 1, so there is no voltage difference across the LED for (int i = 1; i <= 5; i++) { // Do 5 times: