Jump to main content

##

# 3.9.8 mcUtils_LinearRamp

## C

    /* Linear ramp function */
    void mcUtils_LinearRamp(int32_t * const input, const int32_t stepSize, const int32_t finalValue)

## Summary

This function performs the linear ramp on a given input value.

## Description

This function adjusts an input value incrementally towards a final value using a specified step size. This function is typically used to implement a linear ramp for control applications, ensuring a smooth transition between values.

## Precondition

None.

## Parameters

Param | Description
--- | ---
input | Pointer to the current value that will be adjusted towards the final value.
stepSize | The incremental step size used to adjust the input value.
finalValue | The target value that the input value is adjusted towards.

## Returns

None

## Example

    int32_t currentValue=0;

    /* Call the linear ramp function in a loop or control function */
    mcUtils_LinearRamp(&currentValue, 1, 10);

## Remarks

None.