Display the sonar sensor values in the LCD

Dependencies:   C12832 Servo mbed-rtos mbed

Fork of rtos_basic by WIT_EmbOS_Gr1

main.cpp

Committer:
PaulF
Date:
2015-01-19
Revision:
7:c8e192e2c80c
Parent:
3:c92e21f305d8
Child:
8:507111cc659c

File content as of revision 7:c8e192e2c80c:

#include "mbed.h"
#include "rtos.h"
#include "Servo.h"
Servo s1(p21);
Servo s2(p22);
 
AnalogIn p1(p17);
AnalogIn p2(p20); 

 
void p2_thread(void const *args) {
    while (true) {
        s2 = p1*5;
        Thread::wait(1000);
    }
}
 
int main() {
    Thread thread(p2_thread);
    
    while (true) {
        s1 = p1*5;
        Thread::wait(500);
    }
}