| aServo_SetLimits | Index |
Definition:
Parameters:
| servo | - | The index of servo pin whose limits are to be set. |
| limits | - | The offset and resolution bytes combined into an int. |
Return Value:
Description:
This routine sets the offset and resolution for a servo output. The offset may range from 0 to 70. It determines the position when the servo is sent to position 0. This value goes in the high byte of the input parameter. The resolution may range from 1 to 70. It determines the amount of travel per each increment in the servo position. This value goes in the low byte of the input parameter.
Example:
aServo_SetLimits(3, 0x0046);
This would set the limits for servo 3 to achieve a maximum 180 degree range of travel (offset of 0 or 0x00, resolution of 70 or 0x46).
aServo_SetLimits(1, 0x1123);
This would set the limits for servo 1 to achieve a default 90 degree range of travel centered within the possible 180 degree range (offset of 17 or 0x11, resolution of 35 or 0x23).
Related: