| aMo_Steer | Index |
Definition:
Parameters:
| maxspd | - | The maximum speed for both motors. |
| minspd | - | The minimum speed for both motors. |
| dir | - | The direction input. |
Return Value:
Description:
This routine sets the speeds of two modified servos based on a single direction input. This routine can be used to make steering adjustments based on a signed direction input parameter. If the direction input is 0, both motors will go forward. If the direction input is positive, the robot will steer right. If the direction input is negative, the robot will steer left. Inputs with larger absolute values will cause sharper turns. The maxspd and minspd parameters can be used to adjust the maximum forward speed and arc of the sharpest turn. Increasing the minspd parameter will decrease the arc of the sharpest turn. The range for the speed inputs is 0 to 60. The direction input may range from -60 to 60.
Example:
#include <aMyRobot.tea>
#include <aMo.tea>
void main()
{
aMo_Init();
aMo_Steer(60,15,-5);
}
This would adjust the speeds of two modified servos on a robot and make it turn in a wide arc to the left. The aMyRobot.tea file is a copy of the aMo_Def.tea file but has customized data for the servos on the user's robot.
#include <aMyRobot.tea>
#include <aMo.tea>
void main()
{
aMo_Init();
aMo_Steer(60,15,45);
}
This would adjust the speeds of two modified servos on a robot and make it turn in a tight arc to the right. The "aMyRobot.tea" file is a copy of the "aMo_Def.tea" file which contains specific servo parameters for the robot.
Related: