ServoKit.Servo behaviour (servo_kit v0.0.8) View Source
Defines a behaviour required for a servo.
Link to this section Summary
Callbacks
Executes the specified command and returns the updated state. A command is made up of
Initializes the servo.
Link to this section Types
Link to this section Callbacks
Specs
Executes the specified command and returns the updated state. A command is made up of:
a command name atom
a list of arguments for the command, typically first one is a channel number
= ServoKit.StandardServo.call(state, {:set_angle, [0, 90]})
Specs
Initializes the servo.
servo =
%{i2c_bus: "i2c-1"}
|> ServoKit.PCA9685.new()
|> ServoKit.StandardServo.new(%{
angle_max: 180,
duty_cycle_minmax: {2.5, 12.5}
})