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 green_led(LED1); 00004 DigitalOut red_led(LED2); 00005 00006 InterruptIn user_button(USER_BUTTON); 00007 00008 void button_pressed() 00009 { 00010 green_led = 1; 00011 } 00012 00013 void button_released() 00014 { 00015 green_led = 0; 00016 } 00017 00018 int main() { 00019 00020 user_button.rise(&button_pressed); 00021 user_button.fall(&button_released); 00022 00023 while(1) { 00024 red_led = !red_led; 00025 wait(0.2); 00026 } 00027 00028 }
Generated on Tue Jul 19 2022 00:42:10 by
1.7.2