38 lines
732 B
C++
38 lines
732 B
C++
#include "temperature.h"
|
|
|
|
void readTemperature()
|
|
{
|
|
sensors.requestTemperatures();
|
|
float temperatureC = sensors.getTempCByIndex(0) + TEMP_OFFSET_DEG_C;
|
|
lcd.setCursor(13, 3);
|
|
lcd.write(byte(0));
|
|
if (temperatureC == DEVICE_DISCONNECTED_C)
|
|
{
|
|
lcd.print("--");
|
|
}
|
|
else
|
|
{
|
|
lcd.print(temperatureC, 1);
|
|
lcd.print("C");
|
|
}
|
|
}
|
|
|
|
void updateTempDisplay(void *parameter)
|
|
{
|
|
sensors.requestTemperatures();
|
|
float temperatureC = sensors.getTempCByIndex(0) + TEMP_OFFSET_DEG_C;
|
|
lcd.setCursor(13, 3);
|
|
lcd.write(byte(0));
|
|
if (temperatureC == DEVICE_DISCONNECTED_C)
|
|
{
|
|
lcd.print("--");
|
|
}
|
|
else
|
|
{
|
|
lcd.print(temperatureC, 1);
|
|
lcd.print("C");
|
|
}
|
|
|
|
vTaskDelete(NULL); // Delete the task when done
|
|
}
|