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.
Dependencies: mbed BLE_API nRF51822
main.cpp
00001 #include "mbed.h" 00002 #include <cmath> 00003 00004 PwmOut R(LED1); 00005 PwmOut G(LED2); 00006 PwmOut B(LED3); 00007 00008 #define PI 3.14159265358979323846 00009 00010 #define MAX(a,b) a>b?a:b 00011 00012 int main() { 00013 float t = 0.0; 00014 while(1) { 00015 t+=0.01; 00016 R = MAX(sin(t-0*PI/3),0); 00017 G = MAX(sin(t-2*PI/3),0); 00018 B = MAX(sin(t-4*PI/3),0); 00019 wait(0.01); 00020 } 00021 }
Generated on Tue Aug 23 2022 14:47:28 by
1.7.2