This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Calculation for temperature false

In the data sheet of SHT21 is this the formula to calculate the temperature:

T = -46.85 + 175.72 * temp_data / 2^16

temp_data has the value 26'464.

The result should be: T = 24.1°C

But in my code I get this result = 18052.3105

Code:

float temperature;

temperature = (-46.85 + (175.72*(temperature_data / 65536)));

What is wrong with my calculation for the temperature?

Related