Nerves.Grove v0.5.0 Nerves.Grove.Buzzer

Seeed Studio Grove Buzzer

Example

alias Nerves.Grove.Buzzer

{:ok, pid} = Buzzer.start_link(pin)

Buzzer.beep(pid, 0.1)  # make some noise for 100 ms

Summary

Functions

Beeps the buzzer for a specified duration

Switches off the buzzer, stopping the noise

Switches on the buzzer, making a lot of noise

Functions

beep(pid, duration \\ 0.1)

Specs

beep(pid, number) :: any

Beeps the buzzer for a specified duration.

off(pid)

Specs

off(pid) :: any

Switches off the buzzer, stopping the noise.

on(pid)

Specs

on(pid) :: any

Switches on the buzzer, making a lot of noise.

start_link(pin)

Specs

start_link(pos_integer) :: {:ok, pid} | {:error, any}