first compiled version

Dependencies:   mbed-rtos mbed C12832_lcd LM75B

main.cpp

Committer:
robertwharrell
Date:
2014-02-26
Revision:
1:83bc9f91d154
Parent:
0:7ae4f23f84a3
Child:
2:43cd60e0e32f
Child:
3:0945093f48ec

File content as of revision 1:83bc9f91d154:

//Rob in the house

#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) {
    }
}