updated codes lads
Dependencies: C12832 Servo mbed-rtos mbed
Fork of rtos_basic_team by
Diff: main.cpp
- Revision:
- 8:507111cc659c
- Parent:
- 7:c8e192e2c80c
- Child:
- 9:f60eeadabcb0
diff -r c8e192e2c80c -r 507111cc659c main.cpp --- a/main.cpp Mon Jan 19 13:58:04 2015 +0000 +++ b/main.cpp Mon Jan 19 20:41:15 2015 +0000 @@ -1,25 +1,31 @@ #include "mbed.h" #include "rtos.h" #include "Servo.h" +#include "C12832.h" Servo s1(p21); Servo s2(p22); AnalogIn p1(p17); AnalogIn p2(p20); - +C12832 lcd(p5, p7, p6, p8, p11);// lcd is an object from class c12832 initialised by p5,p7.... void p2_thread(void const *args) { while (true) { - s2 = p1*5; - Thread::wait(1000); + s2 = p1*5; + lcd.cls(); // clear the display + lcd.locate(0,3);// the location where you want your charater to be displayed + lcd.printf("Thread one = %f\n", (float)p1*5); + Thread::wait(1500); } } int main() { - Thread thread(p2_thread); - + Thread thread(p2_thread); while (true) { + lcd.cls(); // clear the display + lcd.locate(0,15); // the location where you want your charater to be displayed + lcd.printf("Thread two = %f\n", (float)p2*5); s1 = p1*5; - Thread::wait(500); + Thread::wait(1000); } }