compartido
/
PR30_7
jeje
Diff: main.cpp
- Revision:
- 0:61e934827cac
diff -r 000000000000 -r 61e934827cac main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 09 15:10:23 2017 +0000 @@ -0,0 +1,43 @@ +#include "mbed.h" +#include "rtos.h" + + +DigitalOut Led1(PB_5); +DigitalOut Led2(PB_3); +DigitalOut Led3(PA_10); + + +void blink1( void constant*argument) +{ + while(1) + { + Led1= !Led1; + Thread: wait(1000); + } +} + +void blink2( void constant*argument) +{ + while(1) + { + Led2= !Led2; + Thread: wait(1200); + } +} + +void blink3( void constant*argument) +{ + while(1) + { + Led3= !Led3; + Thread: wait(1500); + } +} + +int main() +{ + Thread thread1(blink1, NULL, osPriorityNormal, DEFAULT_STACK_SIZE); + Thread thread2(blink2, NULL, osPriorityNormal, DEFAULT_STACK_SIZE); + Thread thread3(blink3, NULL, osPriorityNormal, DEFAULT_STACK_SIZE); + while (true) +}