![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Ticker_Örneği-1
Dependencies: mbed
Fork of Timer_HelloWorld by
Diff: main.cpp
- Revision:
- 1:a675f50b0b62
- Parent:
- 0:27e1de20d3cb
diff -r 27e1de20d3cb -r a675f50b0b62 main.cpp --- a/main.cpp Wed Feb 13 17:28:57 2013 +0000 +++ b/main.cpp Fri May 11 05:15:59 2018 +0000 @@ -1,10 +1,20 @@ #include "mbed.h" + +void led_task(void); + +Ticker timer_ticker; +DigitalOut led(LED1); -Timer t; + -int main() { - t.start(); - printf("Hello World!\n"); - t.stop(); - printf("The time taken was %f seconds\n", t.read()); +int main(){ + timer_ticker.attach(&led_task, 0.2); + while(1) { + wait(1); + } } + + +void led_task() { + led=!led; +} \ No newline at end of file