AutoFilm-ESP32/src/temperature.cpp
gronod 200d02e48b Update src/temperature.cpp
Added offset TEMP_OFFSET_DEG_C to assignment of temperatureC
2024-07-03 09:52:48 +01:00

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
}