This is just for bruce!!!

Dependencies:   mbed

main.cpp

Committer:
spyclub
Date:
2014-07-12
Revision:
0:371aa9b6644f

File content as of revision 0:371aa9b6644f:

#include "mbed.h"

PwmOut redpwm(D9);
PwmOut greenpwm(D10);
PwmOut bluepwm(D12);

int main()
{
    int i;
    redpwm.period_ms(10);
    greenpwm.period_ms(10);
    bluepwm.period_ms(10);


 
    while(1) {
        for (i=0; i<11; i++) {
            redpwm.pulsewidth_ms(i);
            printf("redpwm set to %.2f %%\n", redpwm.read() * 100);

            wait(0.1);
        }
        for (i=0; i<11; i++) {
            greenpwm.pulsewidth_ms(i);
            printf("greenpwm set to %.2f %%\n", greenpwm.read() * 100);
            wait(0.1);
        }
        for (i=0; i<11; i++) {
            bluepwm.pulsewidth_ms(i);
            printf("bluepwm set to %.2f %%\n", bluepwm.read() * 100);
            wait(0.1);
        }
    }
 
}