Skip to main content

reporting

Function reporting 

Source
pub fn reporting(address: u8, celsius: f32) -> WordPart
Expand description

A TMP117 that reads what it is asked to.

§Arguments

  • address - the address it answers to.
  • celsius - the temperature it reports, which lands on the nearest 7.8125 m°C.

§Returns

The part.

§Examples

use pamoja_hal::script::DelayLog;
use pamoja_sensors::tmp117::{address, sim, Tmp117};

// A cold room at -18.5 °C.
let part = sim::reporting(address::ADD0_GND, -18.5);
let mut thermometer = Tmp117::new(part, address::ADD0_GND, DelayLog::new());
let reading = thermometer.measure().expect("the part answers");
assert_eq!(reading.celsius(), -18.5);