Skip to content

# Class evam::DirectionalMotor

template <class Driver, signed short kMaxBackward, signed short kMinBackward, signed short kMinForward, signed short kMaxForward>

ClassList > evam > DirectionalMotor

Bidirectional motor controller (forward/reverse). More...

- `#include <evamDirectionalMotor.h>`

Inherits the following classes: Driver

## Public Functions

Type | Name
--- | ---
signed short | GetMaxBackward () const Get maximum reverse output value.
signed short | GetMaxForward () const Get maximum forward output value.
signed short | GetMinBackward () const Get minimum reverse output value.
signed short | GetMinForward () const Get minimum forward output value.
void | Go (signed short aLevel) Apply the control value.
void | SetMaxBackward (signed short aValue) Set maximum reverse output value.
void | SetMaxForward (signed short aValue) Set maximum forward output value.
void | SetMinBackward (signed short aValue) Set minimum reverse output value.
void | SetMinForward (signed short aValue) Set minimum forward output value.
void | SetupRange (signed short aMaxBackward, signed short aMinBackward, signed short aMinForward, signed short aMaxForward) Configure all range parameters at once.

## Detailed Description

Maps a signed input range -1000..1000 to driver-specific output values. Negative values correspond to reverse, positive to forward.

Template parameters:

- `Driver` Driver class (must implement actBipolar(signed short))
- `kMaxBackward` Maximum reverse output value (e.g., -1000)
- `kMinBackward` Minimum reverse output value (e.g., -50)
- `kMinForward` Minimum forward output value (e.g., 50)
- `kMaxForward` Maximum forward output value (e.g., 1000)

## Public Functions Documentation

### function GetMaxBackward

Get maximum reverse output value.

    inline signed short evam::DirectionalMotor::GetMaxBackward () const

Returns:

Current maximum reverse output value.

### function GetMaxForward

Get maximum forward output value.

    inline signed short evam::DirectionalMotor::GetMaxForward () const

Returns:

Current maximum forward output value.

### function GetMinBackward

Get minimum reverse output value.

    inline signed short evam::DirectionalMotor::GetMinBackward () const

Returns:

Current minimum reverse output value.

### function GetMinForward

Get minimum forward output value.

    inline signed short evam::DirectionalMotor::GetMinForward () const

Returns:

Current minimum forward output value.

### function Go

Apply the control value.

    inline void evam::DirectionalMotor::Go (
        signed short aLevel
    )

Parameters:

- `aLevel` Input control value, range -1000..1000.

### function SetMaxBackward

Set maximum reverse output value.

    inline void evam::DirectionalMotor::SetMaxBackward (
        signed short aValue
    )

Parameters:

- `aValue` Output value, clamped to -1000..1000.

### function SetMaxForward

Set maximum forward output value.

    inline void evam::DirectionalMotor::SetMaxForward (
        signed short aValue
    )

Parameters:

- `aValue` Output value, clamped to -1000..1000.

### function SetMinBackward

Set minimum reverse output value.

    inline void evam::DirectionalMotor::SetMinBackward (
        signed short aValue
    )

Parameters:

- `aValue` Output value, clamped to -1000..1000.

### function SetMinForward

Set minimum forward output value.

    inline void evam::DirectionalMotor::SetMinForward (
        signed short aValue
    )

Parameters:

- `aValue` Output value, clamped to -1000..1000.

### function SetupRange

Configure all range parameters at once.

    inline void evam::DirectionalMotor::SetupRange (
        signed short aMaxBackward,
        signed short aMinBackward,
        signed short aMinForward,
        signed short aMaxForward
    )

Parameters:

- `aMaxBackward` Maximum reverse output value (-1000..1000)
- `aMinBackward` Minimum reverse output value (-1000..1000)
- `aMinForward` Minimum forward output value (-1000..1000)
- `aMaxForward` Maximum forward output value (-1000..1000)

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