ServoKit (servo_kit v0.2.0) View Source
Use PCA9685 PWM/Servo Controller in Elixir
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Maps a given value in one range to another range.
Link to this section Types
Specs
options() :: [{:name, GenServer.name()}] | ServoKit.PCA9685.options()
Specs
state() :: ServoKit.PCA9685.t()
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Specs
Maps a given value in one range to another range.
Examples
iex> ServoKit.map(0, {0, 180}, {2.5, 12.5})
2.5
iex> ServoKit.map(45, {0, 180}, {2.5, 12.5})
5.0
iex> ServoKit.map(90, {0, 180}, {2.5, 12.5})
7.5
iex> ServoKit.map(180, {0, 180}, {2.5, 12.5})
12.5
iex> ServoKit.map(0, {-1.0, 1.0}, {2.5, 12.5})
7.5
iex> ServoKit.map(-1, {-1.0, 1.0}, {2.5, 12.5})
2.5
iex> ServoKit.map(1, {-1.0, 1.0}, {2.5, 12.5})
12.5