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.
Fork of Timer_HelloWorld by
main.cpp
00001 #include "mbed.h" 00002 00003 Timer timer_1; 00004 Timer timer_2; 00005 00006 DigitalOut led(LED1); 00007 00008 00009 void task_1(void); 00010 void task_2(void); 00011 00012 int main() { 00013 timer_1.start(); 00014 timer_2.start(); 00015 while(true){ 00016 if (timer_1.read() > 0.1) { 00017 task_1(); 00018 timer_1.reset(); 00019 } 00020 if (timer_2.read() > 1) { 00021 task_2(); 00022 timer_2.reset(); 00023 } 00024 } 00025 } 00026 00027 void task_1(void) { 00028 led = !led; 00029 } 00030 void task_2(void) { 00031 static int sayac = 0; 00032 printf("Sayac:%d \n",sayac); 00033 sayac++; 00034 }
Generated on Thu Jul 28 2022 23:22:30 by
