Amanda Butler
/
Workshop-1-Example-3
Replace Thread::wait with wait
Fork of Workshop-1-Example-3 by
main.cpp
- Committer:
- amaste01
- Date:
- 2017-01-05
- Revision:
- 1:2c029f8a45c8
- Parent:
- 0:04fa7fb0681e
File content as of revision 1:2c029f8a45c8:
#include "mbed.h" #include "rtos.h" DigitalOut led1(LED1); DigitalOut led2(LED2); void led2_thread(void const *args) { while (true) { led2 = !led2; wait(1); } } int main() { //Create a thread to execute the function led2_thread Thread thread(led2_thread); //led2_thread is executing concurrently with main at this point while (true) { led1 = !led1; wait(0.5); } }