Servo
This driver is designed to control a servo motor via PWM (Pulse Width Modulation) signals. It allows for precise positioning of the servo arm by varying the duty cycle of the PWM signal.
Initialization
This must be called before any other servo function in your program. The function sets the servo to its neutral position after initialization.
Parameters:
· MaxDutyCycle: The maximum duty cycle, which corresponds to the servo’s maximum rotation angle.
· MinDutyCycle: The minimum duty cycle, corresponding to the servo’s minimum rotation angle.
· MedDutyCycle: The medium duty cycle, representing the neutral or center position of the servo.
Steering
This function is used for setting specific steering angles. It takes integer values between -100 and 100, with -100 being full left and 100 being full right.
Parameters:
· Direction: Positive Direction values turn the servo right, and negative values turn it left.
Predefined steering angles
· SteerLeft: Moves the servo to its maximum rotation angle (left).
· SteerRight: Moves the servo to its minimum rotation angle (right).
· SteerStraight: Aligns the servo to its neutral position (center).
Last updated