Skip to content

Read temperature and humidity from Sensirion SHT4x sensors in Elixir.

License

Notifications You must be signed in to change notification settings

elixir-sensors/sht4x

Repository files navigation

SHT4X

Hex version CircleCI

Read temperature and humidity from Sensirion SHT4x sensors in Elixir.

Usage

iex> {:ok, sht} = SHT4X.start_link(bus_name: "i2c-1")
{:ok, #PID<0.2190.0>}

iex> SHT4X.get_sample(sht)
%SHT4X.Measurement{
  timestamp_ms: 498436,
  raw_reading_humidity: 28080,
  raw_reading_temperature: 26379,
  temperature_c: 22.38528060913086,
  humidity_rh: 57.131805419921875,
  dew_point_c: 13.492363250293858,
  quality: :fresh
}

For details, see API reference.