Page 65 - RoboGenius Pro C8
P. 65
This chapter introduces you to the fascinating world of VEXcode VR programming, where you will
learn how robots sense their surroundings, make logical decisions and move through complex mazes.
VR ROBOT’S SENSORS
In VEXcode VR, a sensor is a tool that helps the robot understand what’s around it. Sensors allow the
robot to gather information, so it can react to its environment. Here are the main types of sensors:
Sensing-Bumper
These sensors detect when the robot bumps into something. When this happens, the robot can
stop or change direction.
Some of the important Bumper sensing blocks are as follows:
Block Description
This block checks if either the LeftBumper or RightBumper is
LeftBumper pressed?
pressed, based on the selected option.
This block triggers an action when the LeftBumper or
when LeftBumper pressed RightBumper is either pressed or released, depending on the
selected condition.
Sensing-Eye
These sensors help the robot see objects and colours in front of it and below it. The robot can use
this to recognise things or avoid obstacles.
Some of the important Eye sensing blocks are as follows:
Block Description
FrontEye is near object? This block checks if an object is close in front of the robot.
FrontEye detects red ? This block detects a specific colour in the robot’s view.
This block measures the brightness of the surface directly in
FrontEye brightness in %
front of the robot.
This block triggers an action when the Front Eye or Down
when FrontEye detects an object
Eye of Robot detects or or loses an object.
Sensing-Distance
This sensor measures how far an object is from the robot. It helps the robot avoid crashing into
things by telling it how much space is ahead.
Some of the important Distance sensing blocks are as follows:
Block Description
This block checks if the FrontDistance sensor detects any
FrontDistance found an object?
object in front of the robot.
This block measures the distance from the robot to an
FrontDistance in mm
object in millimetres, based on the sensor’s reading.
Sensors, Logic and Maze Navigation
63

