ServoKit

Hex.pm API docs CI

Drive PCA9685 PWM/Servo Controller using Elixir

Installation

You can install this library by adding servo_kit to your list of dependencies in mix.exs:

def deps do
  [
    {:servo_kit, "~> 0.0.5"}
  ]
end

Examples

# Initialize a driver.
%{i2c_bus_name: "i2c-1", frequency: 50}
|> ServoKit.PCA9685.new()
# Set the duty cycle of Channel 0 to 7.5%.
|> ServoKit.PCA9685.set_pwm_duty_cycle(0, 7.5)