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 /* Program Example 9.9: Simple demo of "Ticker". Replicates behaviour of first 00002 led flashing program. 00003 */ 00004 #include "mbed.h" 00005 void led_switch(void); 00006 Ticker time_up; //define a Ticker, with name “time_up” 00007 DigitalOut myled(LED1); 00008 00009 void led_switch(){ //the function that Ticker will call 00010 myled=!myled; 00011 } 00012 00013 int main(){ 00014 time_up.attach(&led_switch, 0.2); //initialises the ticker 00015 while(1){ //sit in a loop doing nothing, waiting for Ticker interrupt 00016 } 00017 } 00018
Generated on Sun Jul 31 2022 09:56:13 by
1.7.2