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 (p23); 00004 PwmOut g (p24); 00005 PwmOut b (p25); 00006 00007 int main() 00008 { 00009 r.period(0.001); 00010 while(1) { 00011 for(float i = 0.0; i < 1.0 ; i += 0.001) { 00012 float p = 3 * i; 00013 r = 1.0 - ((p < 1.0) ? 1.0 - p : (p > 2.0) ? p - 2.0 : 0.0); 00014 g = 1.0 - ((p < 1.0) ? p : (p > 2.0) ? 0.0 : 2.0 - p); 00015 b = 1.0 - ((p < 1.0) ? 0.0 : (p > 2.0) ? 3.0 - p : p - 1.0); ; 00016 wait (0.01); 00017 } 00018 } 00019 }
Generated on Tue Jul 12 2022 12:10:58 by
