Skip to content

# Class evam::ServoDriver

template <int kPin>

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 () Constructor. Attaches the servo to the pin.

## 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.

## 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

Constructor. Attaches the servo to the pin.

    inline evam::ServoDriver::ServoDriver ()

## 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`