first compiled version
Dependencies: mbed-rtos mbed C12832_lcd LM75B
Diff: main.cpp
- Revision:
- 0:7ae4f23f84a3
- Child:
- 1:83bc9f91d154
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Feb 26 05:29:44 2014 +0000 @@ -0,0 +1,47 @@ +#include "mbed.h" +#include "rtos.h" + +AnalogIn pot1(p19); +Queue<float,10> potReadingQueue; + +void lcdUpdate(void const*){ +while(1){ + osEvent evt = potReadingQueue.get(); + if (evt.status == osEventMail) { + float *queue = (float*)evt.value.p; + printf("\nVoltage: %.2f V\n\r" , *queue); + + Thread::wait(1000); + } + } +} + +void readPOT(void const*){ +while(1){ + float *queue; + *queue = pot1; + potReadingQueue.put(queue); + + Thread::wait(10000); + } + +} + +void readTemp(void const*){ + +} + +void threadCookie(void const*){ + +} + +DigitalOut myled(LED1); + +int main() { +Thread threadLCD(lcdUpdate); +Thread threadPOT(readPOT); +Thread threadTemp(readTemp); + + while(1) { + } +}