EvoServo#

class EvoServo#

Class to control a servo motor using the EvoPWMDriver.

Initialisation & Setup

void EvoServo::begin()#

Initializes the servo motor.

EvoServo::EvoServo(ServoChannel servoChannel, ServoType servoType = Default)#

Constructs an EvoServo object.

Parameters:
  • servoChannel – The servo channel to use.

  • servoType – The type of servo motor (default is Default).

Control Functions

void EvoServo::setPulse(int minPulse, int maxPulse)#

Sets the pulse width range for the servo.

Parameters:
  • minPulse – Minimum pulse width.

  • maxPulse – Maximum pulse width.

void EvoServo::setRange(int minRange, int maxRange)#

Sets the rotation range of the servo.

Parameters:
  • minRange – Minimum angle (in degrees).

  • maxRange – Maximum angle (in degrees).

void EvoServo::write(int position)#

Moves the servo to a specific position.

Parameters:

position – Target position (in degrees).

void EvoServo::setPWM(int on, int off)#

Sets the PWM signal for the servo.

Parameters:
  • on – Start time of the pulse.

  • off – End time of the pulse.