Grove module support for the Nerves embedded software framework.
https://hexdocs.pm/nerves_grove/
Seeed Studio Grove Button
alias Nerves.Grove.Button
{:ok, pid} = Button.start_link(pin)
state = Button.read(pid) # check if button is pressed
Seeed Studio Grove Buzzer
alias Nerves.Grove.Buzzer
{:ok, pid} = Buzzer.start_link(pin)
Buzzer.beep(pid, 0.1) # make some noise for 100 ms
Seeed Studio Grove Collision Sensor
alias Nerves.Grove.Sensor
{:ok, pid} = Sensor.Collision.start_link(pin)
state = Sensor.Collision.read(pid) # check if sensor was triggered
Seeed Studio Grove I2C ADC
alias Nerves.Grove.I2C
{:ok, pid} = I2C.ADC.start_link(address)
I2C.ADC.read_voltage(pid)
Seeed Studio Grove LED and Grove LED Socket Kit
alias Nerves.Grove.LED
{:ok, pid} = LED.start_link(pin)
LED.blink(pid)
Seeed Studio Grove OLED Display 96×96
alias Nerves.Grove.OLED
{:ok, pid} = OLED.Display.start_link(address)
OLED.Display.reset(pid)
OLED.Display.clear(pid)
OLED.Display.set_text_position(pid, 0, 0)
OLED.Display.put_string(pid, "Hello, world")
Seeed Studio Grove Relay
alias Nerves.Grove.Relay
{:ok, pid} = Relay.start_link(pin)
Relay.on(pid) # start current flow
Relay.off(pid) # stop current flow
Seeed Studio Grove Rotary Angle Sensor and Grove Slide Potentiometer
alias Nerves.Grove.Potentiometer
{:ok, pid} = Potentiometer.start_link(address)
Potentiometer.read_value(pid)
Seeed Studio Grove Sound Sensor
alias Nerves.Grove.Sensor
{:ok, pid} = Sensor.Sound.start_link(address)
Sensor.Sound.read_value(pid)
Seeed Studio Grove Temperature Sensor
alias Nerves.Grove.Sensor
{:ok, pid} = Sensor.Temperature.start_link(address)
Sensor.Temperature.read_centigrade(pid)
Add nerves_grove
to your list of dependencies in your project's mix.exs
file:
defp deps do
[{:nerves_grove, "~> 0.5.0"}]
end
Alternatively, to pull in the dependency directly from a Git tag:
defp deps do
[{:nerves_grove, github: "bendiken/nerves_grove", tag: "0.5.0"}]
end
Alternatively, to pull in the dependency directly from a Git branch:
defp deps do
[{:nerves_grove, github: "bendiken/nerves_grove", branch: "master"}]
end