michael mosbach
/
panther
a little test for pwm for the motorbridge
Revision 0:eb28177b9e18, committed 2010-11-05
- Comitter:
- moba
- Date:
- Fri Nov 05 20:35:07 2010 +0000
- Commit message:
- Version .0
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Nov 05 20:35:07 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e