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 //This is known as a “header file” 00002 //In short, this copies and pastes the text file 00003 //mbed.h into this code 00004 #include "mbed.h" 00005 00006 //Create a DigitalOut “object” called myled 00007 //Pass constant D7 as a “parameter” 00008 DigitalOut myled(D7); 00009 00010 //The main function - all executable C / C++ 00011 //applications have a main function. This is 00012 //out entry point in the software 00013 int main() { 00014 00015 // ALL the code is contained in a 00016 // “while loop” 00017 while(1) 00018 { 00019 //The code between the { curly braces } 00020 //is the code that is repeated 00021 myled = 1; // External LED is ON 00022 wait(1.0); // 1 second 00023 myled = 0; // LED is OFF 00024 wait(1.0); // External 1 second 00025 } 00026 } 00027 00028 //updated for mbed os 5.4 00029
Generated on Sun Jul 17 2022 15:08:15 by
1.7.2