Testing thread in mbed.

Dependencies:   mbed-rtos mbed

main.cpp

Committer:
akverma
Date:
2016-12-03
Revision:
0:adb256c0dfa9

File content as of revision 0:adb256c0dfa9:

#include "mbed.h"
#include "rtos.h"
 
DigitalOut led1(LED1);
DigitalOut led2(LED2);
 
void led2_thread(void const *args) {
    int i=0;
    while (i<4) {
        led2 = !led2;
        Thread::wait(1000);
        i++;
    }
}
 
int main() {
    led1 = 1;
    led2 = 1;
    uint8_t data[3] = {0x47, 0x32, 0xA7};
    Thread thread(led2_thread);
    
    while (true) {
        led1 = !led1;
        Thread::wait(500);
    }
}