Gerardo Carmona / Mbed 2 deprecated 16_functions2

Dependencies:   mbed

main.cpp

Committer:
gcarmonar
Date:
2013-11-07
Revision:
0:c83cf610a2bb

File content as of revision 0:c83cf610a2bb:

#include "mbed.h"

PwmOut bled(LED1);
PwmOut gled(LED2);
PwmOut rled(LED3);

void color(int red, int green, int blue);

int main() {
    color(20,20,255);
    while(1) {
        
    }
}

void color(int red, int green, int blue){
    float r, g, b;
    
    r = (float)red/255;
    g = (float)green/255;
    b = (float)blue/255;
    
    bled = 1 - b;
    gled = 1 - g;
    rled = 1 - r;
}