https://github.com/mnishiguchi/bh1750
Use BH1750 16-bit ambient light sensor in Elixir
https://github.com/mnishiguchi/bh1750
ambient-light-sensor bh1750 elixir nerves-project
Last synced: 3 months ago
JSON representation
Use BH1750 16-bit ambient light sensor in Elixir
- Host: GitHub
- URL: https://github.com/mnishiguchi/bh1750
- Owner: mnishiguchi
- License: mit
- Created: 2022-01-29T22:29:55.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-27T00:58:20.000Z (almost 3 years ago)
- Last Synced: 2024-09-24T09:49:09.133Z (8 months ago)
- Topics: ambient-light-sensor, bh1750, elixir, nerves-project
- Language: Elixir
- Homepage:
- Size: 19.5 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# BH1750
[](https://hex.pm/packages/bh1750)
[](https://hexdocs.pm/bh1750)
[](https://github.com/mnishiguchi/bh1750/actions/workflows/ci.yml)Use BH1750 16-bit ambient light sensor in Elixir.
## Installation
Add `bh1750` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:bh1750, "~> 0.2"}
]
end
```## Usage
### I2C addressI2C address can be either `0x23` (default) or `0x5C`.
### Start a sensor server
```elixir
{:ok, sensor} = BH1750.start_link
```### Measure the ambient light
```elixir
{:ok, lux} = BH1750.measure(sensor)
```For more information, see [API reference](https://hexdocs.pm/bh1750/api-reference.html).