Skip to main content

milli_fahrenheit

Function milli_fahrenheit 

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

Converts a raw temperature word to millidegrees Fahrenheit.

This is the datasheet’s T = -49 + 315 * S_T / (2^16 - 1) in integer arithmetic, rounded to the nearest millidegree.

§Arguments

  • raw - the 16-bit temperature word.

§Returns

The temperature in millidegrees Fahrenheit, from -49000 to 266000.