updated codes lads
Dependencies: C12832 Servo mbed-rtos mbed
Fork of rtos_basic_team by
main.cpp@7:c8e192e2c80c, 2015-01-19 (annotated)
- Committer:
- PaulF
- Date:
- Mon Jan 19 13:58:04 2015 +0000
- Revision:
- 7:c8e192e2c80c
- Parent:
- 3:c92e21f305d8
- Child:
- 8:507111cc659c
jjj
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 1:491820ee784d | 1 | #include "mbed.h" |
emilmont | 1:491820ee784d | 2 | #include "rtos.h" |
PaulF | 7:c8e192e2c80c | 3 | #include "Servo.h" |
PaulF | 7:c8e192e2c80c | 4 | Servo s1(p21); |
PaulF | 7:c8e192e2c80c | 5 | Servo s2(p22); |
emilmont | 1:491820ee784d | 6 | |
PaulF | 7:c8e192e2c80c | 7 | AnalogIn p1(p17); |
PaulF | 7:c8e192e2c80c | 8 | AnalogIn p2(p20); |
PaulF | 7:c8e192e2c80c | 9 | |
PaulF | 7:c8e192e2c80c | 10 | |
PaulF | 7:c8e192e2c80c | 11 | void p2_thread(void const *args) { |
emilmont | 1:491820ee784d | 12 | while (true) { |
PaulF | 7:c8e192e2c80c | 13 | s2 = p1*5; |
emilmont | 1:491820ee784d | 14 | Thread::wait(1000); |
emilmont | 1:491820ee784d | 15 | } |
emilmont | 1:491820ee784d | 16 | } |
emilmont | 1:491820ee784d | 17 | |
emilmont | 1:491820ee784d | 18 | int main() { |
PaulF | 7:c8e192e2c80c | 19 | Thread thread(p2_thread); |
emilmont | 1:491820ee784d | 20 | |
emilmont | 1:491820ee784d | 21 | while (true) { |
PaulF | 7:c8e192e2c80c | 22 | s1 = p1*5; |
emilmont | 1:491820ee784d | 23 | Thread::wait(500); |
emilmont | 1:491820ee784d | 24 | } |
emilmont | 1:491820ee784d | 25 | } |