FASTBot motor command – Spin Left.
Now you are going to study another useful function of the FASTBot, which spins the bot at its centre point. The right motor is turned forward and the left motor is turned backward. The robot spins to the left with a point between the left and right wheels as the center The speed of both the motors can be adjusted independently.
We do have an exclusive control function to get this spin started.
Double click the Motor Control option in the Functions window, All motor control functions present themselves for your selection and double click the Spin Left to get the study started.
As usual, an interacting window comes out to get your customized data inputs.
You need to define four parameters to make the bot spin to your taste.
The speed of the left motor (backward)
The speed of the right motor (forward)
Timing (optional)
Stop the motors once the action is performed (optional)
Click OK button to generate the code at the cursor defined position.
Format of the function definition with the disabled Stop Motors function:
SpinLeft ( char LeftMotorSpeed, char RightMotorSpeed, int RunTime )
The same function definition with the enabled Stop Motors condition:
SpinLeft_S ( char LeftMotorSpeed, char RightMotorSpeed, int RunTime )
The maximum speed for both motors is 100% and the values must be positive. The maximum run time that can be defined is 65535 milliseconds.
Since the left motor moves backward and the right motor moves forward, the robot turns left. The robot turns with a point between the left and right wheels as the center point. When the speed of both the motors are equal, the robot just spins in place about the center.
When the left motor is stopped and only the right motor is turned forward, it resembles Turn Left function. The robot turns left in an arc with the left wheel as the center in the forward direction.
But when the right motor is stopped and only the left motor is turned backward, the robot turns in the backward direction. The robot turns left in an arc with the right wheel as the center in the backward direction.