Skip to main content

milli_celsius

Function milli_celsius 

Source
pub fn milli_celsius(raw: u16) -> i32
Expand description

Decodes the temperature register to millidegrees Celsius.

The datasheet’s T = raw / 2^16 * 165 - 40, computed in integers and rounded to the nearest millidegree.

§Arguments

  • raw - the 16-bit temperature register.

§Returns

The temperature in millidegrees Celsius, from -40 000 to 124 997.