updated codes lads
Dependencies: C12832 Servo mbed-rtos mbed
Fork of rtos_basic_team by
Diff: main.cpp
- Revision:
- 7:c8e192e2c80c
- Parent:
- 3:c92e21f305d8
- Child:
- 8:507111cc659c
diff -r 209f4db62daf -r c8e192e2c80c main.cpp --- a/main.cpp Tue Jun 04 16:01:32 2013 +0100 +++ b/main.cpp Mon Jan 19 13:58:04 2015 +0000 @@ -1,21 +1,25 @@ #include "mbed.h" #include "rtos.h" - -DigitalOut led1(LED1); -DigitalOut led2(LED2); +#include "Servo.h" +Servo s1(p21); +Servo s2(p22); -void led2_thread(void const *args) { +AnalogIn p1(p17); +AnalogIn p2(p20); + + +void p2_thread(void const *args) { while (true) { - led2 = !led2; + s2 = p1*5; Thread::wait(1000); } } int main() { - Thread thread(led2_thread); + Thread thread(p2_thread); while (true) { - led1 = !led1; + s1 = p1*5; Thread::wait(500); } }