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 int test; //variable used in for loop to increment and decrement 00004 00005 DigitalOut led1(LED1); 00006 DigitalOut led2(LED2); 00007 DigitalOut led3(LED3); 00008 DigitalOut led4(LED4); 00009 00010 int main() { 00011 while (test < 5) { 00012 00013 if (test == 0) { 00014 led1 = 1; 00015 wait(0.1); 00016 led1 = 0; 00017 wait(0.1); 00018 }; 00019 00020 if (test ==1) { 00021 led2 = 1; 00022 wait(0.1); 00023 led2 = 0; 00024 wait(0.1); 00025 }; 00026 00027 if (test ==2) { 00028 led3 = 1; 00029 wait(0.1); 00030 led3 = 0; 00031 wait(0.1); 00032 }; 00033 00034 if (test ==3) { 00035 led4 = 1; 00036 wait(0.1); 00037 led4 = 0; 00038 wait(0.1); 00039 } 00040 00041 test++; 00042 00043 if (test == 4) { 00044 test--; 00045 led3 = 1; 00046 wait(0.1); 00047 led3 = 0; 00048 wait(0.1); 00049 00050 test--; 00051 led2 = 1; 00052 wait(0.1); 00053 led2 = 0; 00054 wait(0.1); 00055 00056 test--; 00057 led1 = 1; 00058 wait(0.1); 00059 led1 = 0; 00060 wait(0.1); 00061 } 00062 } 00063 }
Generated on Mon Jul 18 2022 01:50:26 by
1.7.2