HMC5883L

Build Status

This is an OTP application for reading the HMC5883L magnetic compass. It utilizes elixir_ale for configuring and reading the compass over i2c bus.

Configuration

config :hmc5883l, sensors: [
    %{
        name: "ch1",
        i2c: "i2c-1",
        config: %{
            gain: 1.3,
        mode: :continuous,
        bias: :normal,
        data_rate: 15,
        averaging: 8
        }
    }
]

name : used to identify the sensor and name processes i2c : name of the i2c bus to connect to the sensor on config : compass configuration values. See HMC5883L.CompassConfiguration for more information

Installation

Available in Hex, the package can be installed as:

  1. Add hmc5883l to your list of dependencies in mix.exs:

    def deps do

     [{:hmc5883l, "~> 0.5.0"}]

    end

  2. Ensure hmc5883l is started before your application:

    def application do

     [applications: [:hmc5883l]]

    end