FASTBot motor command – Go Front.
Go Front function moves both motors, left and right, in the forward direction with the pre defined equal speed. So the robot moves forward. If required, the motors can be stopped after the running time.
To activate this, double click on Motor Control in the Function Window.
Now, you can see the list of available functions under the Motor Control. Again double click on Go Front function to start the code generation.
You should see the dialog box coming up to get your inputs as shown here:
As you can see, you need to define three parameters:
-
The speed of both the motors (forward)
-
The function run time (optional)
-
Stopping the motors after the action is performed (optional)
This running time indicates how long the motors can continue to move forward once they are started. Then you can define whether the motors are to be stopped after moving forward for the run time.
The format of the function without the Stop Motors setting is shown here:
GoFront (char Speed, int RunTime)
The motor speed can be set as percentage with the maximum of 100% and the values must be positive. Time delay is mentioned here in the units of milliseconds. You can define any value with the maximum of 65535 milliseconds.
When you activate the last option, Stop Motors, the format of the function changes to
GoFront_S ( char Speed, int RunTime )
Here, (_S) in the function name indicates the active stop condition.
Only positive motor speed values are allowed for all functions except Move Motors. Violating this rule will result in the bot going nowhere.
If you don’t activate this stop function, the bot moves forward even after the set Run Time has lapsed, until a new motor command is given. So if no motor commands are given after this statement, the FASTBot moves forward forever. Naturally, you need to take care of this in the remaining part of your applications.
Remember that the “Stop Motors” option can only be used when the Run Time is greater than zero milliseconds. Otherwise, this motor command will be of no use.
The following figure indicates, how your program looks like when defining your dialog box.