Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:fc65feb74d3f, committed 2019-10-14
- Comitter:
- marcospostemsky
- Date:
- Mon Oct 14 03:00:37 2019 +0000
- Commit message:
- Control RG de los leds.
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 fc65feb74d3f main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 14 03:00:37 2019 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" + +PwmOut r(LED_RED); +PwmOut g(LED_GREEN); + +int main() +{ + r.period(0.001f); + g.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); + wait (0.0025f); + } + } +}
diff -r 000000000000 -r fc65feb74d3f mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Oct 14 03:00:37 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file