GrovePi v0.2.0 GrovePi.Board

Low-level interface for sending raw requests and receiving responses from a GrovePi hat. Create one of these first and then use one of the other GrovePi modules for interacting with a connected sensor, light, or actuator.

To check that your GrovePi hardware is working, try this:

iex> GrovePi.Board.firmware_version()
"1.2.2"

Summary

Functions

Get the version of firmware running on the GrovePi’s microcontroller

Get a response to a previously send request to the GrovePi. This is not normally called directly

Write directly to a device on the I2C bus. This is used for sensors that are not controlled by the GrovePi’s microcontroller

Send a request to the GrovePi. This is not normally called directly except when interacting with an unsupported sensor

Functions

firmware_version()
firmware_version() :: binary | {:error, term}

Get the version of firmware running on the GrovePi’s microcontroller.

get_response(len)
get_response(integer) :: binary | {:error, term}

Get a response to a previously send request to the GrovePi. This is not normally called directly.

i2c_write_device(address, buffer)

Write directly to a device on the I2C bus. This is used for sensors that are not controlled by the GrovePi’s microcontroller.

send_request(message)
send_request(binary) :: :ok | {:error, term}

Send a request to the GrovePi. This is not normally called directly except when interacting with an unsupported sensor.

start_link(address, opts \\ [])