ServoKit.ContinuousServo (servo_kit v0.0.8) View Source
The abstraction of the continuous servo.
Link to this section Summary
Functions
Change the motor movement, ranging from -1.0 (full throttle reverse) to 1.0 (full throttle forward).
Link to this section Types
Specs
t() :: %ServoKit.ContinuousServo{ driver: struct(), duty_cycle_mid: float(), duty_cycle_minmax: {float(), float()} }
Configuration options for this module.
driver
: A driver struct.duty_cycle_minmax
: A tuple of duty cycle min and max in percent.duty_cycle_mid
: A duty cycle in percent at which the servo stops its movement.
Link to this section Functions
Change the motor movement, ranging from -1.0 (full throttle reverse) to 1.0 (full throttle forward).
{:ok, state} = ServoKit.ContinuousServo.set_throttle(state, 8, 1.0) # Full throttle forward
{:ok, state} = ServoKit.ContinuousServo.set_throttle(state, 8, -1.0) # Full throttle reverse
{:ok, state} = ServoKit.ContinuousServo.set_throttle(state, 8, 0.0) # Stop the movement