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 // The following sequence is presented: 00004 // GREEN - 1 second 00005 // BLUE - 1 second 00006 // RED - 1 second 00007 // WHITE - 1 second 00008 // ALL OFF - 4 seconds 00009 00010 00011 #define OFF 1 00012 #define ON 0 00013 #define TIME 1 00014 00015 DigitalOut myled_blue(LED1); 00016 DigitalOut myled_green(LED2); 00017 DigitalOut myled_red(LED3); 00018 void all_off(void); 00019 void all_on(void); 00020 00021 int main() 00022 { 00023 while(1) { 00024 all_off(); 00025 myled_green = ON; 00026 wait(TIME); 00027 all_off(); 00028 00029 myled_blue = ON; 00030 wait(TIME); 00031 all_off(); 00032 00033 myled_red = ON; 00034 wait(TIME); 00035 all_off(); 00036 00037 all_on(); //WHITE 00038 wait(TIME); 00039 all_off(); 00040 00041 wait(TIME*4); 00042 } 00043 } 00044 00045 void all_off(void) 00046 { 00047 myled_green = OFF; 00048 myled_blue = OFF; 00049 myled_red = OFF; 00050 } 00051 00052 void all_on(void) 00053 { 00054 myled_green = ON; 00055 myled_blue = ON; 00056 myled_red = ON; 00057 }
Generated on Wed Jul 20 2022 10:18:56 by
1.7.2