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.
Dependencies: mbed
main.cpp
00001 #include "mbed.h" 00002 00003 DigitalOut red_led(D7); 00004 DigitalOut yellow_led(D6); 00005 DigitalOut green_led(D5); 00006 DigitalIn SW1(D4); 00007 00008 int main() { 00009 00010 //Switch on Yellow and Green to indicate 00011 //that the code is running 00012 yellow_led = 1; 00013 green_led = 1; 00014 red_led = 0; //Set RED LED to OFF 00015 00016 // Wait for SW1 to be pressed 00017 while (SW1 == 0) { } 00018 00019 red_led = 1; //Turn ON LED 00020 00021 while (1) { } //Repeat forever 00022 }
Generated on Fri Jul 15 2022 16:23:38 by
1.7.2