pub fn reporting(celsius: f32, relative_humidity: f32) -> WordPartExpand description
An HDC1080 that reads what it is asked to.
§Arguments
celsius- the temperature it reports.relative_humidity- the humidity it reports, as a percentage.
§Returns
The part. Its readings land on the nearest steps its 14-bit converters represent, within three thousandths of a degree and two thousandths of a percent.
§Examples
use pamoja_hal::script::DelayLog;
use pamoja_sensors::hdc1080::{sim, Hdc1080};
let mut sensor = Hdc1080::new(sim::reporting(4.0, 91.0), DelayLog::new());
let reading = sensor.measure().expect("the part answers");
assert!((reading.celsius() - 4.0).abs() < 0.01);