# AHT20

[![API docs](](

Use [AHT20]( temperature & humidity sensor in Elixir.

## Usage

Here's an example use:

# Detect I2C devices.
iex> Circuits.I2C.detect_devices()
Devices on I2C bus "i2c-1":
 * 56  (0x38)

1 devices detected on 1 I2C buses

# Connect to the sensor.
iex> {:ok, aht20} = AHT20.start_link(bus_name: "i2c-1", bus_address: 0x38)
{:ok, #PID<0.1407.0>}

# Read the humidity and temperature from the sensor.
iex> AHT20.read_data(aht20)
   raw_humidity: 158_119,
   raw_temperature: 410_343,
   relative_humidity: 15.079402923583984,
   temperature_c: 28.26671600341797,
   temperature_f: 82.88008880615234

Depending on your hardware configuration, you may need to modify the call to
`AHT20.start_link/1`. See `t:AHT20.Sensor.config/0` for parameters.