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 #include "swpol.hpp" 00003 00004 DigitalOut led1(LED1); 00005 00006 DigitalOut red_led(PE_15); 00007 DigitalOut yellow_led(PB_10); 00008 DigitalOut green_led(PB_11); 00009 DigitalIn sw1(PE_12); 00010 DigitalIn sw2(PE_14); 00011 00012 SWPoll switch1(sw1, red_led); 00013 SWPoll switch2(sw2, green_led); 00014 00015 Timer t; 00016 00017 // main() runs in its own thread in the OS 00018 int main() { 00019 t.start(); 00020 while(1) { 00021 if (t.read_ms() >= 500) { 00022 yellow_led = !yellow_led; 00023 t.reset(); 00024 } 00025 switch1.poll(); 00026 switch2.poll(); 00027 }; 00028 } 00029
Generated on Sat Jul 16 2022 15:05:37 by
1.7.2