https://github.com/tattdcodemonkey/bno055
Elixir Application to control 1 or more adafruit BNO055 sensors
https://github.com/tattdcodemonkey/bno055
Last synced: about 1 year ago
JSON representation
Elixir Application to control 1 or more adafruit BNO055 sensors
- Host: GitHub
- URL: https://github.com/tattdcodemonkey/bno055
- Owner: TattdCodeMonkey
- License: mit
- Created: 2015-12-28T04:20:29.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-09-01T17:04:54.000Z (almost 6 years ago)
- Last Synced: 2025-04-10T21:47:46.198Z (about 1 year ago)
- Language: Elixir
- Size: 30.9 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# BNO-055
This module is used to create commands for interacting with a Bosch BNO055 sensor. This module is intended to be an unopinionated collection of functions to created data for communicating with the sensor, but does not handle actual communication.
Set functions return tuple with address and data to be written to that address
```elixir
iex> BNO055.set_mode(:config)
{0x3D, <<0x00>>}
```
Get functions return tuple with address and number of bytes to read
```elixir
iex> BNO055.get_chip_address
{0x00, 1}
```
`write` functions take the get or set results and return a binary for writing to the
device based on the protocol type
```elixir
iex> BNO055.set_mode(:config) |> BNO055.i2c_write_data
<<0x3D, 0x00>>
iex> BNO055.set_mode(:config) |> BNO055.serial_write_data
<<0xAA, 0x00, 0x3D, 0x01, 0x00>>
```
Decode functions take the binary data returned from sensor and formats the result.
## Installation
Available in Hex, the package can be installed as:
1. Add bno055 to your list of dependencies in `mix.exs`:
def deps do
[{:bno055, "~> 1.0"}]
end