Driver for the Freescale MPL3115A2 barometric pressure/temperature/altimeter board connected via I2C.
Go to file
James Harton 830a5046a0 Merge branch 'renovate/configure' into 'master'
Configure Renovate

See merge request jimsy/mpl3115a2!1
2020-07-21 02:46:11 +00:00
config Add the MPL3115A2 driver. 2019-10-07 15:10:47 +13:00
lib Fix credo warnings. 2020-01-30 20:21:49 +13:00
test Switch to Wafer. 2020-01-23 17:30:48 +13:00
.formatter.exs Empty mix application. 2019-10-07 13:04:11 +13:00
.gitignore Empty mix application. 2019-10-07 13:04:11 +13:00
.gitlab-ci.yml Add gitlab CI. 2020-01-30 20:15:31 +13:00
LICENSE Switch to Wafer. 2020-01-23 17:30:48 +13:00
mix.exs Bump to 0.3.0. 2020-01-30 20:07:33 +13:00
mix.lock Switch to Wafer. 2020-01-23 17:30:48 +13:00
README.md Add the MPL3115A2 driver. 2019-10-07 15:10:47 +13:00
renovate.json Add renovate.json 2020-07-21 02:34:16 +00:00

MPL3115A2

Elixir driver for the MPL3115A2 barometric pressure, altitude and temperature sensor. I'm using Adafruit's breakout.

Usage

Add your device to your config like so:

config :mpl3115a2,
  devices: [%{bus: "i2c-1", address: 0x60}]

And start your application. Your devices will be reset with defaults and you will be able to take temperature and pressure or altitude readings. See MPL3115A2.Commands.initialize!/1 for more details on the default initialization.

This device is capable of much more advanced usage than the MPL3115A2.Device module makes use of. It was all that I needed at the time. For advanced usage you can use the MPL3115A2.Commands and MPL3115A2.Registers modules directly. Feel free to send PR's.

Installation

If available in Hex, the package can be installed by adding mpl3115a2 to your list of dependencies in mix.exs:

def deps do
  [
    {:mpl3115a2, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/mpl3115a2.