lab05-app-shield-temp checking the temperature using on board sensor

Dependencies:   C12832 LM75B

main.cpp

Committer:
namcheol
Date:
2020-05-11
Revision:
1:6f643c62279d
Parent:
0:f31836d48420

File content as of revision 1:6f643c62279d:

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

C12832 lcd(D11, D13, D12, D7, D10); //lcd = (MOSI, SCK, RESET, A0, nCS)
LM75B temp(D14, D15);               //I2C

int main()
{
    lcd.cls();  //clear screen 
    lcd.locate(0, 6);
    lcd.printf("Current temperature!");
    while(true){
        lcd.locate(0, 16);
        lcd.printf("%5.2f degree Celsius", temp.read());
        thread_sleep_for(1000);
        }
}