ServoKit (servo_kit v0.0.8) View Source

A collection of convenience functions to use this library.

Link to this section Summary

Functions

Runs a quick-test program for the Continuous Servo.

Runs a quick-test program for the LED brightness.

Runs a quick-test program for the Standard Servo.

Initializes a continuous servo. For options, see ServoKit.ContinuousServo documentation.

Initializes a ServoController.

Initializes a standard servo. For options, see ServoKit.StandardServo documentation.

Change the angle for a starndard servo.

Change the throttle for a continuous servo.

Link to this section Functions

Link to this function

hello_continuous_servo(channel)

View Source

Runs a quick-test program for the Continuous Servo.

ServoKit.hello_continuous_servo(8)

Runs a quick-test program for the LED brightness.

ServoKit.hello_led(15)
Link to this function

hello_standard_servo(channel)

View Source

Runs a quick-test program for the Standard Servo.

ServoKit.hello_standard_servo(0)
Link to this function

init_continuous_servo(servo_options \\ %{})

View Source

Initializes a continuous servo. For options, see ServoKit.ContinuousServo documentation.

pid = ServoKit.init_continuous_servo()
Link to this function

init_servo_controller(args)

View Source

Initializes a ServoController.

pid = ServoKit.init_servo_controller(
  driver_module: ServoKit.PCA9685,
  driver_options: %{},
  servo_module: ServoKit.StandardServo,
  servo_options: %{}
)
Link to this function

init_standard_servo(servo_options \\ %{})

View Source

Initializes a standard servo. For options, see ServoKit.StandardServo documentation.

pid = ServoKit.init_standard_servo()
Link to this function

set_angle(pid, channel, angle)

View Source

Change the angle for a starndard servo.

# Set the angle to 90 degrees for Channel 0.
ServoKit.set_angle(pid, 0, 90)
Link to this function

set_throttle(pid, channel, throttle)

View Source

Change the throttle for a continuous servo.

# Set the throttle to full speed reverse for Channel 8.
ServoKit.set_throttle(pid, 8, -1)