ServoKit.ServoController (servo_kit v0.0.8) View Source

Wraps a servo module and controls a servo using that module. The servo state will be kept in a process.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Delegates the specified operation to the servo driver, and updates the servo state as needed.

Starts a servo driver process.

Discovers a servo process by servo module name.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

child_spec(servo_module, list)

View Source
Link to this function

run_command(pid, command)

View Source

Delegates the specified operation to the servo driver, and updates the servo state as needed.

ServoKit.ServoController.run_command(pid, {:set_angle, [0, 180]})
Link to this function

start_link(servo_module, list)

View Source

Starts a servo driver process.

driver = ServoKit.PCA9685.new()
{:ok, pid} = ServoKit.ServoController.start_link(ServoKit.StandardServo, [driver, %{}])

Discovers a servo process by servo module name.