GR_Peach_Abhinav_Rahul
/
test_thread
Testing thread in mbed.
Revision 0:adb256c0dfa9, committed 2016-12-03
- Comitter:
- akverma
- Date:
- Sat Dec 03 07:25:30 2016 +0000
- Commit message:
- Basic thread implementation using RTOS.
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Dec 03 07:25:30 2016 +0000 @@ -0,0 +1,26 @@ +#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); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-rtos.lib Sat Dec 03 07:25:30 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-rtos/#58563e6cba1e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Dec 03 07:25:30 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/d75b3fe1f5cb \ No newline at end of file