EJEMPLO3

Dependencies:   mbed

main.cpp

Committer:
fabeltranm
Date:
2018-05-07
Revision:
1:0f682b1c98ec
Parent:
0:a550aef65fac

File content as of revision 1:0f682b1c98ec:

#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);
    
}