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 led1(LED1); 00004 PwmOut led2(LED2); 00005 PwmOut led3(LED3); 00006 PwmOut led4(LED4); 00007 00008 int main() { 00009 while (1) { 00010 for (float p = 0.01f; p < 0.999f; p += 0.01f) { 00011 led1 = p; 00012 wait(0.01); 00013 } 00014 for (float p = 0.999f; p > 0.01f; p -= 0.01f) { 00015 led1 = p; 00016 wait(0.01); 00017 } 00018 00019 wait(2); 00020 00021 for (float p = 0.01f; p < 0.999f; p += 0.01f) { 00022 led2 = p; 00023 wait(0.01); 00024 } 00025 for (float p = 0.999f; p > 0.01f; p -= 0.01f) { 00026 led2 = p; 00027 wait(0.01); 00028 } 00029 00030 wait(2); 00031 00032 for (float p = 0.01f; p < 0.999f; p += 0.01f) { 00033 led3 = p; 00034 wait(0.01); 00035 } 00036 for (float p = 0.999f; p > 0.01f; p -= 0.01f) { 00037 led3 = p; 00038 wait(0.01); 00039 } 00040 00041 wait(2); 00042 00043 for (float p = 0.01f; p < 0.999f; p += 0.01f) { 00044 led4 = p; 00045 wait(0.01); 00046 } 00047 for (float p = 0.999f; p > 0.01f; p -= 0.01f) { 00048 led4 = p; 00049 wait(0.01); 00050 } 00051 00052 wait(2); 00053 00054 } 00055 }
Generated on Mon Sep 19 2022 02:09:54 by
1.7.2