![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
gjgfadjsgfodsafkjsdof
Revision 0:2db3563168ff, committed 2016-12-03
- Comitter:
- DSPMARCO
- Date:
- Sat Dec 03 06:50:49 2016 +0000
- Commit message:
- my test1
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 Dec 03 06:50:49 2016 +0000 @@ -0,0 +1,20 @@ +#include "mbed.h" + +PwmOut r(PTB18); +PwmOut g(PTB19); +PwmOut b(PTD1); +int main() +{ + r.period(0.001f); + g.period(0.001f); + b.period(0.001f); + while (true) { + for (float i = 0.0f; i < 1.0f ; i += 0.001f) { + float p = 3 * i; + r = 1.0f - ((p < 1.0f) ? 1.0f - p : (p > 2.0f) ? p - 2.0f : 0.0f); + g = 1.0f - ((p < 1.0f) ? p : (p > 2.0f) ? 0.0f : 2.0f - p); + b = 1.0f - ((p < 1.0f) ? p : (p > 2.0f) ? 0.0f : 2.0f - p); + wait (0.0025f); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Dec 03 06:50:49 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/d75b3fe1f5cb \ No newline at end of file