GrovePi v0.6.1 GrovePi.PivotPi View Source

This module lets you interact with the PivotPi through the GrovePi.

Plug your PivotPi into the GrovePi I2C-1 port. Plug your servo motor into channel 1. You must initialize the PivotPi board using GrovePi.PivotPi.initialize/0.

iex> GrovePi.PivotPi.start()
:ok
iex> GrovePi.PivotPi.angle(1, 180)
:ok
iex> GrovePi.PivotPi.angle(1, 90)
:ok
iex> GrovePi.PivotPi.angle(1, 0)
:ok
iex> GrovePi.PivotPi.led(1, 100)
:ok
iex> GrovePi.PivotPi.led(1, 50)
:ok
iex> GrovePi.PivotPi.led(1, 0)
:ok

Link to this section Summary

Functions

Move the Servo motor to a new position. Accepts angle from 0-180

Initialize the PivotPi board

Control the PivotPi LEDs. Channel # should match Servo #. Accepts % from 0-100

Link to this section Types

Link to this type angle() View Source
angle() :: 0..180
Link to this type channel() View Source
channel() :: 1..8
Link to this type percent() View Source
percent() :: 0..100

Link to this section Functions

Link to this function angle(channel, angle) View Source
angle(channel(), angle()) :: :ok | {:error, term()}

Move the Servo motor to a new position. Accepts angle from 0-180.

Link to this function initialize() View Source
initialize() :: :ok | {:error, term()}

Initialize the PivotPi board.

Link to this function led(channel, percent) View Source
led(channel(), percent()) :: :ok | {:error, term()}

Control the PivotPi LEDs. Channel # should match Servo #. Accepts % from 0-100.