| aMotion_SetRampTarget | Index |
Definition:
Parameters:
| channel | - | Motion control channel. |
| posH | - | Most significant 2 bytes of 4-byte travel distance. |
| posL | - | Least significant 2 bytes of 4-byte travel distance. |
Return Value:
Description:
This routine sets the ramp travel distance for a motion control channel. The distance is a four-byte term and must be broken up into 2 integers. See the cmdMO_RMPCFG documentation for details on configuring a ramp motion for motion control channel.
Example:
#include <aMotion.tea>
aMotion_SetRampTarget(0, 0x0002, 0x03F0);
aMotion_SetRampTarget(1, 0x0002, 0x03F0);
This would set the travel distance to 0x000203F0 for both wheels on a 2-wheel drive robot. This is equivalent to 132,080 encoder ticks. The actual distance depends on the drive train of the robot.
#include <aMotion.tea>
aMotion_SetRampTarget(0, 0, 500);
aMotion_SetRampTarget(1,-1,-500);
This would set the travel distance to 500 for motor 0 and -500 for motor 1. This would make a 2-wheel drive robot rotate until it counted 500 encoder ticks.
Related: