Motors
Motor blocks are blocks which controls the motors on Buggy Base directly. This gives the user the ability to fine tune the behavior of the motors. The motors are referenced as Motor "A" or "B" depending on the side it resides. These blocks can set the movement direction of the motors (Motor - Set Speed block) or brake / stop the motors (Motor - Stop block).
Block: Set Speed
The motors speed and direction can be controlled with the Motor - Set Speed block.
Note: This block is NOT holding. Which means once the motor's speed is set, then the program will go to the next block immediately. The motor will continue to run.
|
Function: This block sets the speed of the selected motor.
- Motor - select motor (either A, B, or AB (both)).
- Speed - rate to set the selected Motor. A value between -255 and 255. Negative values will spin the motor in reverse.
- 0 being off
- 127 being half speed forward.
- 255 being full speed forward
- -255 being full speed backward
- -127 being half speed backward
|
Example 1: Turn Motor "A" on to full speed
Description: When activated, Motor "A" will turn on at full speed (255).
Example 2: Spinning Buggy Base
Note: this example is performed in offline mode .
|
|
Example
|
|
Description: When activated, the motors on Buggy Base will turn in opposite directions, which causes a spinning motion. As described below.
The following will loop forever:
- Motor "A" (speed 255) and "Motor "B" (speed -255) are set to spin in opposite directions. This causes the Buggy Base to spin clockwise.
- 3 second pause.
- Motor "A" (speed -255) and "Motor "B" (255) are set to spin in opposite directions. This causes the Buggy Base to spin counter-clockwise.
- 3 second pause.
Block: Stop
The motors can be stopped with the Motor - Stop block.
Function: This block stops the selected motor.
- Motor - select motor to stop (either A, B, or AB (both)).
|
Example 1: Repeatedly turn on and off Motor "A"
|
Example
|
|
Description: When activated, Motor "A" will repeatedly turn on and off with a 1 second delay in between.