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.
main.cpp
00001 #include "mbed.h" 00002 00003 PwmOut r(LED_RED); 00004 PwmOut g(LED_GREEN); 00005 00006 int main() 00007 { 00008 r.period(0.001f); 00009 g.period(0.001f); 00010 00011 while (true) { 00012 for (float i = 0.0f; i < 1.0f ; i += 0.001f) { 00013 float p = 3 * i; 00014 r = 1.0f - ((p < 1.0f) ? 1.0f - p : (p > 2.0f) ? p - 2.0f : 0.0f); 00015 g = 1.0f - ((p < 1.0f) ? p : (p > 2.0f) ? 0.0f : 2.0f - p); 00016 wait (0.0025f); 00017 } 00018 } 00019 }
Generated on Sun Aug 21 2022 06:15:57 by
1.7.2