AHT20.Calc (aht20 v0.1.0) View Source

A collection of calculation functions.

Link to this section Summary

Functions

Calculates the temperature in Celsius.

Calculates the temperature in Fahrenheit.

Obtains the humidity value from the sensor output.

Obtains the temperature value from the sensor output.

Calculates the relative humidity in percent.

Link to this section Functions

Link to this function

celsius_from_raw_temperature(raw_temperature)

View Source

Specs

celsius_from_raw_temperature(integer()) :: float()

Calculates the temperature in Celsius.

iex> AHT20.Calc.celsius_from_raw_temperature(410343)
28.26671600341797
Link to this function

fahrenheit_from_raw_temperature(raw_temperature)

View Source

Specs

fahrenheit_from_raw_temperature(integer()) :: float()

Calculates the temperature in Fahrenheit.

iex> AHT20.Calc.fahrenheit_from_raw_temperature(410343)
82.88008880615234
Link to this function

raw_humidity_from_sensor_output(sensor_output)

View Source

Specs

raw_humidity_from_sensor_output(<<_::56>>) :: integer()

Obtains the humidity value from the sensor output.

iex> AHT20.Calc.raw_humidity_from_sensor_output(<<28, 38, 154, 118, 66, 231, 118>>)
158119
Link to this function

raw_temperature_from_sensor_output(sensor_output)

View Source

Specs

raw_temperature_from_sensor_output(<<_::56>>) :: integer()

Obtains the temperature value from the sensor output.

iex> AHT20.Calc.raw_temperature_from_sensor_output(<<28, 38, 154, 118, 66, 231, 118>>)
410343
Link to this function

relative_humidity(raw_humidity)

View Source

Specs

relative_humidity(integer()) :: float()

Calculates the relative humidity in percent.

iex> AHT20.Calc.relative_humidity(158119)
15.079402923583984