Encendido y regulado de LEDs via PWM.

Dependencies:   mbed

main.cpp

Committer:
AreTchE
Date:
2014-10-07
Revision:
0:b128bbb35377

File content as of revision 0:b128bbb35377:

#include "mbed.h"

PwmOut rled(LED_RED);
PwmOut gled(LED_GREEN);
PwmOut bled(LED_BLUE);
 
int main() {
    rled = gled = bled = 1;
    while(1) {
        for(float i=0.0; i<=1.0; i+=0.005) {
            rled = i;
            wait(0.01);
        }
        for(float i=0.0; i<=1.0; i+=0.005) {
            gled = i;
            wait(0.01);
        }
        for(float i=0.0; i<=1.0; i+=0.005) {
            bled = i;
            wait(0.01);
        }
    }
}