CodeShare
Dependencies: mbed
Revision 0:3a5416fc52a1, committed 2016-09-25
- Comitter:
- jeremycai3721
- Date:
- Sun Sep 25 20:19:50 2016 +0000
- Commit message:
- CodeShare
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 |
diff -r 000000000000 -r 3a5416fc52a1 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Sep 25 20:19:50 2016 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" + +PwmOut GREEN(p22); // normal LED +PwmOut BLUE(p21); // normal LED + +AnalogIn AinBLUE(p20); +AnalogIn AinGREEN(p19); + + +int main() +{ + float dcBLUE; // 50% duty cycle + float dcGREEN; + + GREEN.period(0.01f); // 0.01 second period + BLUE.period(0.01f); // 0.01 second period + + while (1) { + dcBLUE = 0.5*AinBLUE; + dcGREEN = 0.5*AinGREEN; + BLUE.write(dcBLUE); + GREEN.write(dcGREEN); + wait(0.1); + } + return 0; +} \ No newline at end of file
diff -r 000000000000 -r 3a5416fc52a1 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Sep 25 20:19:50 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/2241e3a39974 \ No newline at end of file