BULME

Dependencies:   mbed LM75B

main.cpp

Committer:
wf
Date:
2019-09-17
Revision:
6:4755c585b051
Parent:
5:608f2bf4d3f7

File content as of revision 6:4755c585b051:

#include "mbed.h"
#include "LM75B.h"

LM75B sensor(p28,p27);
Serial pc(USBTX,USBRX);

int main ()
{
    pc.baud(9600);
    //Try to open the LM75B
    if (sensor.open()) {
        pc.printf("Device detected!\n");
        while (1) {
          pc.printf("Temp = %.3f\n", (float)sensor.temp());
            wait(1.0);
        }

    } else {
        error("Device not detected!\n");
    }

}