# HTS221


An Elixir library for working with the HTS221 sensor via the I2C protocol. This sensor reports relative humidity
and temperature.

For more information about the HTS221 sensor please see the resources section below.

## Installation

The package can be installed by adding `hts221` to your list of dependencies in `mix.exs`:

def deps do
    {:hts221, "~> 0.1.1"}

## Usage

iex> {:ok, hts221} = HTS221.start_link("i2c-1")
{:ok, #PID<0.1483.0>}
iex> HTS221.temperature(hts221)
iex> HTS221.humidity(hts221)

We have to pass the I2C bus name into the `HTS221.start/2` and `HTS221.start_link/2`
functions to connect to the HTS221. See [Elixir Circuits I2C package](
for more information about using I2C with Elixir.

By default the temperature is read in degrees Celsius. However, we can change the
scale that is return by passing the `:scale` option to the `HTS221.temperature/2` function

iex> HTS221.temperature(hts221, scale: :fahrenheit)

## Resources 

### Docs

- [HTS221 datasheet](
- [Interpreting humidity and temperature readings](

### Recommended Hardware

The hardware below is what I have used to develop, however this should would with
any supported hardware that [Nerves]( supports.

- [PMOD HTS221](
- [Raspberry PI PMOD Hat](
- [Raspberry PI zero](