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 static const double MIN_T = 0.04; 00004 static const double MAX_T = 0.20; 00005 00006 int main() { 00007 DigitalOut led[] = {LED1, LED2, LED3, LED4}; 00008 00009 double t = MAX_T; 00010 int dir = -1; // decrement 00011 for (;;) { 00012 for (int i = 0; i <= 2; i++) { 00013 led[i] = 1; 00014 wait(t); 00015 led[i] = 0; 00016 } 00017 for (int i = 3; i >= 1; i--) { 00018 led[i] = 1; 00019 wait(t); 00020 led[i] = 0; 00021 } 00022 00023 t += dir * 0.01; 00024 if (t >= MAX_T || t <= MIN_T) { 00025 dir = -dir; 00026 } 00027 } 00028 }
Generated on Mon Aug 8 2022 17:32:44 by
1.7.2