ferney alberto beltran molina
/
TimerE3RTOS
EJEMPLO3
main.cpp
- Committer:
- fabeltranm
- Date:
- 2017-10-28
- Revision:
- 0:a550aef65fac
- Child:
- 1:0f682b1c98ec
File content as of revision 0:a550aef65fac:
#include "mbed.h" Ticker tk1; Ticker tk2; DigitalOut output1(LED1); // digital output Serial serial(USBTX, USBRX); void task1(void); // task function prototype void task2(void); // task function prototype //*** main code void main() { output1=0; tk1.attach(&task1, 0.8); tk2.attach(&task2, 0.6); while(1) { wait_ms(2000); output1=!output1; // toggle output } } void task1(void){ // task function serial.printf("hola soy task1\n"); wait_ms(300); } void task2(void){ // task function serial.printf("hola soy task2\n"); wait_ms(300); }