pub struct Temperature {
pub raw_value: u8,
pub offset: i8,
}Expand description
Stores the raw ADC value and can be used to calculate the temperature in Celsius using the
formula: (raw_value * 0.4386) - (offset * 27.88) - 20.52.
Fields§
§raw_value: u8Raw ADC value.
offset: i8Offset value - depends on the temperature range configured.
Implementations§
Source§impl Temperature
impl Temperature
Sourcepub fn to_celsius(&self) -> f32
pub fn to_celsius(&self) -> f32
Returns the temperature in Celsius.
Sourcepub fn to_fahrenheit(&self) -> f32
pub fn to_fahrenheit(&self) -> f32
Returns the temperature in Fahrenheit.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Temperature
impl RefUnwindSafe for Temperature
impl Send for Temperature
impl Sync for Temperature
impl Unpin for Temperature
impl UnsafeUnpin for Temperature
impl UnwindSafe for Temperature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more