AHT20.Measurement (aht20 v0.1.0) View Source

One sensor measurement report. Only the raw temperature and raw humidity values are computed directly from the sensor. All other values are derived.

Link to this section Summary

Functions

Converts raw sensor output into human-readable format.

Link to this section Types

Specs

t() :: %AHT20.Measurement{
  raw_humidity: number(),
  raw_temperature: number(),
  relative_humidity: number(),
  temperature_c: number(),
  temperature_f: number()
}

Link to this section Functions

Link to this function

from_sensor_output(sensor_output)

View Source

Converts raw sensor output into human-readable format.

iex> AHT20.Measurement.from_sensor_output(<<28, 38, 154, 118, 66, 231, 118>>)
%AHT20.Measurement{
  raw_humidity: 158119,
  raw_temperature: 410343,
  relative_humidity: 15.079402923583984,
  temperature_c: 28.26671600341797,
  temperature_f: 82.88008880615234
}