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 //Hello mbed world 1 00002 #include "mbed.h" 00003 00004 DigitalOut led1(LED1); 00005 DigitalOut led2(LED2); 00006 DigitalOut led3(LED3); 00007 DigitalOut led4(LED4); 00008 00009 int main() { 00010 int currentLed = 0; 00011 while(1) { 00012 currentLed++; 00013 if (currentLed > 4) currentLed = 1; 00014 if (currentLed == 1) { 00015 led1 = 1; 00016 led4 = 0; 00017 }else if (currentLed == 2) { 00018 led2 = 1; 00019 led1 = 0; 00020 }else if (currentLed == 3) { 00021 led3 = 1; 00022 led2 = 0; 00023 }else if (currentLed == 4) { 00024 led4 = 1; 00025 led3 = 0; 00026 } 00027 00028 wait(0.2); 00029 00030 } 00031 }
Generated on Fri Aug 19 2022 19:41:14 by
1.7.2