GrovePi v0.6.1 GrovePi.Board View Source

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"

Link to this section 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

Link to this section Functions

Link to this function firmware_version(prefix \\ Default) View Source
firmware_version(atom()) :: binary() | {:error, term()}

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

Link to this function get_response(len) View Source
get_response(integer()) :: binary() | {:error, term()}
Link to this function get_response(prefix, len) View Source
get_response(atom(), integer()) :: binary() | {:error, term()}

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

Link to this function i2c_write_device(address, buffer) View Source

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

Link to this function send_request(prefix, message) View Source
send_request(GenServer.server(), binary()) :: :ok | {:error, term()}

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

Link to this function start_link(address, prefix, opts \\ []) View Source