gaborsimon / WeatherStation

This project is intended to provide a self-made, basic weather station based on ATMEL AVR microcontroller and HD44780 LCD display.
MIT License
0 stars 0 forks source link

Temperature measurement bug #20

Closed gaborsimon closed 6 years ago

gaborsimon commented 6 years ago

The temperature measurement calculation is not correct in the LCDManager.c source file:

line 242: LCD_WriteInt((uint8)((XDHT22__TEMPERATURE_VALUE - ((sint8)XDHT22__TEMPERATURE_VALUE)) * 10.0f));

The negativ value of the fraction is calculated wrongly. The method has to use the absolute values: (uint8)(( absf(XDHT22__TEMPERATURE_VALUE) - (uint8)absf(XDHT22__TEMPERATURE_VALUE) ) * 10.0f)