"Fun with LEDs" example project, for use with FRDM-KL25Z insert

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 PwmOut blue(LED_BLUE);
00003 PwmOut green(LED_GREEN);
00004 PwmOut red(LED_RED);
00005 
00006 int main() {
00007     while(1) {
00008         // Mix Colors! 
00009         // Use any number between 0 (100% ON) and 1 (OFF).
00010         blue = 0.75;   // Blue mostly OFF
00011         red = 0.25;   // Red mostly ON
00012         green = 1.0;   // Green OFF
00013         wait(0.1);   // wait for 100ms
00014     }
00015 }