ok

Dependencies:   mbed

main.cpp

Committer:
DeanArm7
Date:
2017-11-28
Revision:
1:0260e05c8e83
Parent:
0:0302f3c057c9

File content as of revision 1:0260e05c8e83:

#include "mbed.h"

DigitalOut myled1(LED1);
DigitalOut myled2(LED2);

AnalogIn   tempin(p16);

Serial pc(USBTX, USBRX); // tx, rx


int main() {
    myled1 = 0;
    myled2 = 0;
    float test=0;
 
    while(1) {
        wait(0.5);
        
        test = tempin;
         pc.printf("%f\n\r",test);
        if(tempin > 0.28f){ //going above max temp
            myled1 = 0;
            myled2 = 1;
            }
        if(tempin < 0.28f){ //going below max temp
            myled1 = 1;
            myled2 = 0;
            }
    }
}