shorter off time

Dependencies:   mbed

Fork of hackspace_awesomeness by Leicester Hackspace

main.cpp

Committer:
tony1tf
Date:
2014-07-12
Revision:
2:2537a40d2ac8
Parent:
1:8bd923cbd0e5

File content as of revision 2:2537a40d2ac8:

#include "mbed.h"
// for kl25 external 3 colour LED
PwmOut redpwm(D5);
PwmOut greenpwm(D6);
PwmOut blue(D7)
int main()
{
    int i;
    redpwm.period_ms(10);
    greenpwm.period_ms(10);
    bluepwm.period_ms(10);


//   printf("pwm set to %.2f %%\n", mypwm.read() * 100);

    while(1) {
        for (i=0; i<11; i++) {
            redpwm.pulsewidth_ms(i);
            wait(0.1);
        }
        for (i=0; i<11; i++) {
            greenpwm.pulsewidth_ms(i);
            wait(0.1);
        }
        for (i=0; i<11; i++) {
            bluepwm.pulsewidth_ms(i);
            wait(0.1);
        }