michael mosbach
/
panther
a little test for pwm for the motorbridge
Diff: main.cpp
- Revision:
- 0:eb28177b9e18
diff -r 000000000000 -r eb28177b9e18 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Nov 05 20:35:07 2010 +0000 @@ -0,0 +1,20 @@ +#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; + } + + } +} \ No newline at end of file