AHT20.Sensor (aht20 v0.3.1) View Source

Represents the AHT20 sensor.

Link to this section Summary

Types

t()

The options that are required for the sensor initialization.

Link to this section Types

Specs

bus_address() :: AHT20.Transport.bus_address()

Specs

bus_name() :: AHT20.Transport.bus_name()

Specs

config() :: [bus_name: bus_name(), bus_address: bus_address()]

Specs

t() :: %AHT20.Sensor{bus_address: bus_address(), transport: pid()}

The options that are required for the sensor initialization.

  • :bus_name - which I2C bus to use (defaults to "i2c-1")
  • :bus_address - the address of the AHT20 (defaults to 0x38)

Link to this section Functions

Specs

init(config()) :: {:ok, t()} | {:error, any()}

Specs

measure(t()) :: {:ok, <<_::56>>} | {:error, any()}