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
Fork of LAB5_RGBpwmout by
Diff: main.cpp
- Revision:
- 0:f845ee7a1910
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Jun 28 08:26:38 2016 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+
+PwmOut led1(PTB18);
+PwmOut led2(PTB19);
+PwmOut led3(PTD1);
+
+float i=0;
+
+int main()
+{
+ led1.period_ms(20);
+ led2.period_ms(20);
+ led3.period_ms(20);
+
+ while(1)
+ {
+ for(i=0;i<1;i=i+0.1)
+ {
+ led1=i;
+ led2=1-i;
+ led3=1;
+ wait(0.2);
+ }
+
+ for(i=0;i<1;i=i+0.1)
+ {
+ led2=i;
+ led3=1-i;
+ led1=1;
+ wait(0.2);
+ }
+ for(i=0;i<1;i=i+0.1)
+ {
+ led3=i;
+ led1=1-i;
+ led2=1;
+ wait(0.2);
+ }
+ }
+}
