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 PwmOut b (LED_BLUE); 00006 00007 int main() { 00008 r.period(0.001); 00009 g.period(0.001); 00010 b.period(0.001); 00011 00012 while (true) { 00013 for (float i = 0.0; i < 1.0 ; i += 0.001) { 00014 float p = 3 * i; 00015 r = 1.0 - ((p < 1.0) ? 1.0 - p : (p > 2.0) ? p - 2.0 : 0.0); 00016 g = 1.0 - ((p < 1.0) ? p : (p > 2.0) ? 0.0 : 2.0 - p); 00017 b = 1.0 - ((p < 1.0) ? 0.0 : (p > 2.0) ? 3.0 - p : p - 1.0); 00018 wait (0.0025); 00019 } 00020 } 00021 }
Generated on Wed Jul 13 2022 18:12:21 by
1.7.2