Giter VIP home page Giter VIP logo

hmc5883l's Introduction

HMC5883L

Hex version

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

  • HMC5883L: OTP Application, supervises HMC5883L.State & HMC5883L.Supervisor. Also exposes public API

    • start/2: starts application
  • Event Manager:

    • {:raw_reading, {x,y,z}} - raised with raw x, y, z axis reading from i2c bus
    • {:scaled_reading, {x,y,z}} - raised with scaled x, y, z axis reading from i2c bus. scale is based on current gain setting
    • {:heading, decoded_heading} - raised when heading is decoded from a scaled reading
    • {:available, boolean_availibity} - raised with true when HMC5883L.Driver is successfully initialized, raised with false when HMC5883L.Driver terminates

    Event manager is registered with a named based on the configured sensor name, following the template :hmc5883l_[name]_evtmgr.

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: elixir def deps do [{:hmc5883l, "~> 0.5.0"}] end

  2. Ensure hmc5883l is started before your application:

```elixir  
    def application do
      [applications: [:hmc5883l]]
    end
```

hmc5883l's People

Contributors

tattdcodemonkey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

lukeledet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.