a little test for pwm for the motorbridge

Dependencies:   mbed

main.cpp

Committer:
moba
Date:
2010-11-05
Revision:
0:eb28177b9e18

File content as of revision 0:eb28177b9e18:

#include "mbed.h"

// Fade a led on.

PwmOut led1(LED1);
PwmOut led2(LED2);
int main() {
    while (1) {
        led2 = 1-led1;
        led1 = led1 + 0.01;
        wait(0.02);
        if (led1 == 1.0) {
            led1 = 0;
        }
        if (led2 == 0) {
            led2 = 1,0;
        }

    }
}