Skip to main content

burst_for

Function burst_for 

Source
pub fn burst_for(
    celsius: f32,
    hectopascals: f32,
    relative_humidity: f32,
) -> [u8; 8]
Expand description

The eight data registers that compensate to a reading.

§Arguments

  • celsius - the temperature to land on.
  • hectopascals - the pressure to land on.
  • relative_humidity - the humidity to land on, as a percentage.

§Returns

The bytes, against CALIBRATION. They are the converter values the compensation turns back into that reading, found by searching, because the formulas only run one way.

§Examples

use pamoja_sensors::bme280::{sim, RawMeasurement};

let burst = sim::burst_for(20.44, 848.05, 44.65);
let reading = sim::calibration().compensate(&RawMeasurement::from_registers(&burst));
assert_eq!(reading.temperature_centi_celsius, 2044);