RGB color LCD Test (PWM) for BlackOne

Dependencies:   mbed

main.cpp

Committer:
techand
Date:
2012-03-10
Revision:
0:a22b8f104ce3

File content as of revision 0:a22b8f104ce3:

#include "mbed.h"

//DigitalOut myled(LED1);
PwmOut blue(p24);
PwmOut green(p25);
PwmOut red(p26);

int main() {
    while(1) {
        for(float p = 0.0f; p < 1.0f; p += 0.05f) {
            blue = p;
            green = 1 - p;
            wait(0.04);
        }
        for(float p = 0.0f; p < 1.0f; p += 0.05f) {
            red = p;
            blue = 1 - p;
            wait(0.04);
        }
        for(float p = 0.0f; p < 1.0f; p += 0.05f) {
            green = p;
            red = 1 - p;
            wait(0.04);
        }
    }
}