Skip to content

# Class evam::ServoDriver

template <int kPin, int kMinPulse, int kMiddlePulse, int kMaxPulse>

ClassList > evam > ServoDriver

Servo driver using standard Arduino Servo library. More...

- `#include <evamServoDriver.h>`

## Public Functions

Type | Name
--- | ---
int | GetPin () const Get the servo pin number.
| ServoDriver ()
| ServoDriver (ServoConfig config, Args... args)

## Protected Functions

Type | Name
--- | ---
void | actBipolar (signed short aValue) Bipolar (centered) control. Input range -1000..1000. Output: 1500Вµs В± input_mapped.
void | actUnipolar (signed short aValue) Unipolar (absolute) control. Input range 0..1000. Output: 1000Вµs + input_mapped.

## Detailed Description

Supports both bipolar (centered) and unipolar (absolute) control modes.

Template parameters:

- `kPin` Servo signal pin number.
- `kMinPulse` Minimum pulse width in microseconds (default: 1000)
- `kMiddlePulse` Middle pulse width in microseconds (default: 1500)
- `kMaxPulse` Maximum pulse width in microseconds (default: 2000)

## Public Functions Documentation

### function GetPin

Get the servo pin number.

    inline int evam::ServoDriver::GetPin () const

Returns:

Pin number used for servo signal.

### function ServoDriver [1/2]

    inline evam::ServoDriver::ServoDriver ()

### function ServoDriver [2/2]

    template<typename... Args>
    inline evam::ServoDriver::ServoDriver (
        ServoConfig config,
        Args... args
    )

## Protected Functions Documentation

### function actBipolar

Bipolar (centered) control. Input range -1000..1000. Output: 1500Вµs В± input_mapped.

    inline void evam::ServoDriver::actBipolar (
        signed short aValue
    )

Parameters:

- `aValue` Input value, range -1000..1000, clamped to 500..2500Вµs output.

### function actUnipolar

Unipolar (absolute) control. Input range 0..1000. Output: 1000Вµs + input_mapped.

    inline void evam::ServoDriver::actUnipolar (
        signed short aValue
    )

Parameters:

- `aValue` Input value, range 0..1000, clamped to 500..2500Вµs output.

The documentation for this class was generated from the following file `src/evamServoDriver.h`