Improved visual effect. KL25Z RGB PWM LED Control, one color at a time + all colour combinations.

Dependencies:   mbed

main.cpp

Committer:
lmsousa
Date:
2015-05-06
Revision:
2:67db082298a6
Parent:
1:5160ea45399b
Child:
3:20358798a986

File content as of revision 2:67db082298a6:

#include "mbed.h"

PwmOut rled(LED_RED);
PwmOut gled(LED_GREEN);
PwmOut bled(LED_BLUE);

int main()
{
    while(1) {
        for(float p = 0.00f; p < 1.00f; p += 0.01f) {
            rled = p;
            wait(0.01);
        }
        wait (0.5);
        for(float p = 0.00f; p < 1.00f; p += 0.01f) {
            gled = p;
            wait(0.01);
        }
        wait (0.5);
        for(float p = 0.00f; p < 1.00f; p += 0.01f) {
            bled = p;
            wait(0.01);
        }
        wait (0.5);
    }
}