This is just for bruce!!!
Dependencies: mbed
Revision 0:371aa9b6644f, committed 2014-07-12
- Comitter:
- spyclub
- Date:
- Sat Jul 12 16:17:04 2014 +0000
- Commit message:
- Special code just for Bruce
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 Sat Jul 12 16:17:04 2014 +0000 @@ -0,0 +1,35 @@ +#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); + } + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Jul 12 16:17:04 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae \ No newline at end of file