ServoKit.Driver behaviour (servo_kit v0.0.8) View Source
Defines a behaviour required for a servo driver.
Link to this section Summary
Callbacks
Initializes the servo driver and returns the initial state.
Sets a single PWM channel or all PWM channels by specifying the duty cycle in percent.
Sets the PWM frequency to the provided value in hertz. The PWM frequency is shared by all the channels.
Link to this section Callbacks
Specs
Initializes the servo driver and returns the initial state.
driver = ServoKit.PCA9685.new(%{i2c_bus: "i2c-1"})
Specs
Sets a single PWM channel or all PWM channels by specifying the duty cycle in percent.
driver ServoKit.PCA9685.set_pwm_duty_cycle(driver, 0, 50.0)
driver ServoKit.PCA9685.set_pwm_duty_cycle(driver, :all, 50.0)
Specs
set_pwm_frequency(map(), pos_integer()) :: struct() | :no_return
Sets the PWM frequency to the provided value in hertz. The PWM frequency is shared by all the channels.
driver = ServoKit.PCA9685.set_pwm_frequency(state, 50)