Macro#
Introduction#
The VEX AIM Coding Robot includes macros, which are prebuilt actions that combine multiple robot behaviors into one block. Macros can make the robot act out emotions, turn until an object is detected, or move toward objects detected by the AI Vision Sensor.
Below is a list of all blocks:
Actions — Run prebuilt robot behaviors.
act — Makes the robot act out a selected emotion.
turn until object — Turns the robot until the AI Vision Sensor detects a selected object.
get object — Moves the robot to collect a selected object.
move to object — Moves the robot toward a selected object.
Actions#
act#
The act stack block makes the robot perform a selected emotion using movements, sounds, emojis, and LEDs.
act [happy v]
Parameter |
Description |
|---|---|
emotions |
The emotion for the robot to act out:
|
Example
when started
[React to kicking a sports ball.]
kick object [medium v]
act [happy v]
turn until object#
The turn until object stack block turns the robot until the AI Vision Sensor detects an object.
Note: If the robot has difficulty detecting objects, try lowering the robot’s turn velocity with the set turn velocity block.
turn [right v] until [sports ball v] found
Parameter |
Description |
|---|---|
direction |
The direction for the robot to turn:
|
objects |
The object for the AI Vision Sensor to detect:
|
Example
when started
[Turn left until an orange barrel is detected.]
turn [left v] until [orange barrel v] found
get object#
The get object stack block drives the robot toward a detected object until it attaches to the robot’s magnet.
Note: AprilTag IDs cannot be selected because they do not have magnets.
Note: If the robot has difficulty detecting objects, try lowering the robot’s move and turn velocities with the set move velocity and set turn velocity blocks.
get [sports ball v]
Parameter |
Description |
|---|---|
objects |
The object for the robot to collect:
|
Example
when started
[Find and kick a sports ball.]
turn [right v] until [sports ball v] found
get [sports ball v]
kick object [medium v]
move to object#
The move to object stack block moves the robot toward an object detected by the AI Vision Sensor.
Note: If the robot has difficulty detecting objects, try lowering the robot’s move and turn velocities with the set move velocity and set turn velocity blocks.
move to [AIM robot v]
Parameter |
Description |
|---|---|
objects |
The object for the robot to move toward:
|
Example
when started
[Approach the closest AIM Robot.]
turn [right v] until [AIM robot v] found
move to [AIM robot v]