Sensing#
Brain Sensing#
Reset Timer#
The Reset Timer block is used to reset the EXP Brain’s timer.
The Brain’s timer begins at the beginning of each project. The reset timer block is used to reset the timer back to 0 seconds.
In this example, the Brain will print the current time after waiting 2 seconds before resetting its timer.
Timer Value#
The Timer Value block is used to report the value of the EXP Brain’s timer in seconds.
The timer starts at 0 seconds when the program starts, and reports the timer’s value as a decimal value.
In this example, the Brain will print the current time after waiting 2 seconds before resetting its timer.
Cursor Column#
The Cursor Column block is used to report the column number of the EXP Brain’s screen cursor location.
The Cursor Column block will report a value from 1-80 and will start on column 1 at the start of a project.
In this example, the Brain will move the cursor to (3, 7) and then print the current column (7) on the Brain’s screen.
Cursor Row#
The Cursor Row block is used to report the row number of the EXP Brain’s screen cursor location.
The Cursor Column block will report a value from 1-9 and will start on row 1 at the start of a project.
In this example, the Brain will move the cursor to (3, 7) and then print the current row (3) on the Brain’s screen.
Battery Voltage#
The Battery Voltage block is used to report the voltage of the EXP Brain’s battery.
The Battery Voltage block reports a range from 6 volts to 9 volts.
In this example, the Brain will print its current battery voltage on the Brain’s screen.
Battery Current#
The Battery Current block is used to report the current of the EXP Brain’s battery.
The Battery Current block reports a range from 0.0 amps to 15.0 amps.
In this example, the Brain will print its current battery current on the Brain’s screen.
Battery Capacity#
The Battery Capacity block is used to report the charge level of the EXP Brain’s battery.
The Battery Capacity block reports a range from 0% to 100%.
In this example, the Brain will print its current battery charge on the Brain’s screen.
Controller Sensing#
Controller Pressed#
The Controller Pressed block is used to report if a button on the EXP Controller is pressed.
The Controller Pressed block reports True
when the selected Controller button is pressed.
The Controller Pressed block reports False
when the selected Controller button is not pressed.
Choose which Controller button to use.
In this example, the Brain will print a message on its screen the first time the A button on the controller is pressed.
Position of Controller#
The Position of Controller block is used to report the position of a joystick on the EXP Controller along an axis.
The Position of Controller block reports a range from -100 to 100.
The Position of Controller block reports 0 when the joystick axis is centered.
Choose the joystick’s axis.
In this example, the Brain will print the 3rd axis of the EXP Controller’s joysticks.
Controller Enable/Disable#
The Controller Enable/Disable block is used to enable or disable Controller configured actions from the Devices menu.
Choose to either enable or disable the configured Controller actions. By default, the Controller is Enabled in every project.
In this example, the Controller will be disabled at the start of the project and be re-enabled after the drivetrain has moved forward for 6 inches.
Motor Sensing#
Motor is Done?#
The Motor is Done? block is used to report if the selected EXP Smart Motor or Motor Group has completed its movement.
The Motor is Done? block reports True
when the selected Motor or Motor Group has completed its movement.
The Motor is Done? block reports False
when the selected Motor or Motor Group is still moving.
Choose which Motor or Motor Group to use.
Motor is Spinning?#
The Motor is Spinning? block is used to report if the selected EXP Smart Motor or Motor Group is currently moving.
The Motor is Spinning? block reports True
when the selected Motor or Motor Group is moving.
The Motor is Spinning? block reports False
when the selected Motor or Motor Group is not moving.
Choose which Motor or Motor Group to use.
Position of Motor#
The Position of Motor block is used to report the distance an EXP Smart Motor or the first motor of a Motor Group has traveled.
Choose which Motor or Motor Group to use.
Choose the units to report in, degrees or turns.
In this example, the Motor will spin forward for 1 second before its current position is printed on the Brain’s screen.
Velocity of Motor#
The Velocity of Motor block is used to report the current velocity of an EXP Smart Motor or the first motor of a Motor Group.
The Velocity of Motor block reports a range from -100% to 100% or -600rpm to 600rpm.
Choose which Motor or Motor Group to use.
Choose the units to report in, percent (%) or rpm.
In this example, the Motor will spin forward for 1 second before its current velocity is printed on the Brain’s screen.
Current of Motor#
The Current of Motor block is used to report the amount of current a EXP Smart Motor or Motor Group is drawing in amperes (amps).
Choose which Motor or Motor Group to use.
In this example, the Motor will spin forward for 1 second before its current is printed on the Brain’s screen.
Power of Motor#
The Power of Motor block is used to report the amount of power output a EXP Smart Motor or the first motor of a Motor Group is currently generating.
Choose which Motor or Motor Group to use.
In this example, the Motor will spin forward for 1 second before its current power is printed on the Brain’s screen.
Torque of Motor#
The Torque of Motor block is used to report the amount of torque (rotational force) a EXP Smart Motor or the first motor of a Motor Group is currently using.
The Torque of Motor block reports a range from 0.0 to 18.6 inch-pounds (InLB) or 0.0 to 2.1 Newton-meters (Nm).
Choose which Motor or Motor Group to use.
Choose the units to report in, Nm or InLb.
In this example, the Motor will spin forward for 1 second before its current torque is printed on the Brain’s screen.
Efficiency of Motor#
The Efficiency of Motor block is used to report the efficiency of a EXP Smart Motor or the first motor of a Motor Group.
The Efficiency of Motor block reports a range from 0% to 100%, determined by the value of the power (in watts) the motor is using (input), versus the amount of power (in watts) the motor is providing (output).
An EXP Smart Motor or Motor Group typically reaches a maximum efficiency of 65% under normal use cases.
Choose which Motor or Motor Group to use.
In this example, the Motor will spin forward for 1 second before its current efficiency is printed on the Brain’s screen.
Temperature of Motor#
The Temperature of Motor block is used to report the temperature of a EXP Smart Motor or the first motor of a Motor Group.
The Temperature of Motor block reports a range from 0% to 100%.
Choose which Motor or Motor Group to use.
In this example, the Motor will spin forward for 1 second before its current temperature is printed on the Brain’s screen.
Drivetrain Sensing#
Drive is Done?#
The Drive is Done? block is used to report if the Drivetrain has completed its movement.
The Drive is Done? block reports True
when the Drivetrain’s motors have completed their movement.
The Drive is Done? block reports False
when the sDrivetrain’s motors are still moving.
Drive is Moving?#
The Drive is Moving? block is used to report if the Drivetrain is currently moving.
The Drive is Moving? block reports True
when the Drivetrain’s motors are moving.
The Drive is Moving? block reports False
when the sDrivetrain’s motors are not moving.
Drive Heading#
The Drive Heading block is used to report the direction that the Drivetrain is facing by using the Inertial sensor’s current angular position.
The Drive Heading block reports a range from 0.0 to 359.99 degrees.
In this example, the Drivetrain will turn to the right for 1 second before its current heading is printed on the Brain’s screen.
Drive Rotation#
The Drive Rotation block is used to report the Drivetrain’s angle of rotation.
A clockwise direction is reported as a positive value, and a counterclockwise value is reported as a negative value.
In this example, the Drivetrain will turn to the left for 1 second before its current rotation is printed on the Brain’s screen.
Drive Velocity#
The Drive Velocity block is used to report the current velocity of the Drivetrain.
The Drive Velocity block reports a range from -100% to 100% or -600rpm to 600rpm.
Choose the units to report in, percent (%) or rpm.
In this example, the Drivetrain will drive forward for 1 second before its current velocity is printed on the Brain’s screen.
Drive Current#
The Drive Current block is used to report the amount of current (power) that the Drivetrain is currently using.
In this example, the Drivetrain will drive forward for 1 second before its current is printed on the Brain’s screen.
Drive Power#
The Drive Power block is used to report the amount of power output the Drivetrain is currently generating.
In this example, the Drivetrain will drive forward for 1 second before its current power is printed on the Brain’s screen.
Drive Torque#
The Drive Torque block is used to report the amount of torque (rotational force) the Drivetrain is currently using.
The Drive Torque block reports a range from 0.0 to 18.6 inch-pounds (InLB) or 0.0 to 2.1 Newton-meters (Nm).
Choose the units to report in, Nm or InLb.
In this example, the Drivetrain will drive forward for 1 second before its current torque is printed on the Brain’s screen.
Drive Efficiency#
The Drive Efficiency block is used to report the efficiency of the Drivetrain.
The Drive Efficiency block reports a range from 0% to 100%, determined by the value of the power (in watts) the motor is using (input), versus the amount of power (in watts) the motor is providing (output).
An EXP Drivetrain typically reaches a maximum efficiency of 65% under normal use cases.
In this example, the Drivetrain will drive forward for 1 second before its current efficiency is printed on the Brain’s screen.
Drive Temperature#
The Drive Temperature block is used to report the temperature of the EXP Smart Motors powering the Drivetrain.
The Drive Temperature block reports a range from 0% to 100%.
In this example, the Drivetrain will drive forward for 1 second before its current temperature is printed on the Brain’s screen.
Bumper Sensing#
Bumper Pressed#
The Bumper Pressed block is used to report if the Bumper Switch is pressed.
The Bumper Pressed block reports True
when the selected Bumper Switch is pressed.
The Bumper Pressed block reports False
when the selected Bumper Switch is not pressed.
Choose which Bumper Switch to use.
In this example, the Brain will print a message on its screen the first time the Bumper Switch is pressed.
Limit Sensing#
Limit Pressed#
The Limit Pressed block is used to report if the Limit Switch is pressed.
The Limit Pressed block reports True
when the selected Limit Switch is pressed.
The Limit Pressed block reports False
when the selected Limit Switch is not pressed.
Choose which Limit Switch to use.
In this example, the Brain will print a message on its screen the first time the Limit Switch is pressed.
Gyro Sensing#
Calibrate#
The Calibrate block is used to calibrate the Gyro/Inertial Sensor to reduce the amount of drift. It is recommended that this block is used at the start of the project.
The Brain must remain still for calibration process to succeed, which takes approximately 2 seconds.
Choose which Gyro/Inertial Sensor to use.
In this example, the Brain’s Inertial Sensor will calibrate for 2 seconds before printing the current orientation of the Inertial Sensor.
Set Heading#
The Set Heading block is used to set the Gyro/Inertial sensor’s current heading position to a set value.
The Set Heading block accepts a range of 0.0 to 359.99 degrees.
Choose which Gyro/Inertial Sensor to use.
In this example, the Brain’s Inertial sensor will print its starting heading, set its heading to 90 degrees, and then print the new heading.
Set Rotation#
The Set Rotation block is used to set the Gyro/Inertial sensor’s current rotation position to a set value.
The Set Rotation block accepts any positive or negative decimal or integer number.
Choose which Gyro/Inertial Sensor to use.
In this example, the Brain’s Inertial sensor will print its starting rotation, set its rotation to -100 degrees, and then print the new rotation.
Angle of Heading#
The Angle of Heading block is used to report the 3-Wire Gyro Sensor or EXP Inertial Sensor’s current heading in degrees.
The Angle of Heading block reports a range from 0.0 to 359.99 degrees.
Choose which Gyro/Inertial Sensor to use.
In this example, the Brain’s Inertial sensor will print its starting heading, set its heading to 90 degrees, and then print the new heading.
Angle of Rotation#
The Angle of Rotation block is used to report the 3-Wire Gyro Sensor or EXP Inertial Sensor’s current rotation in degrees.
A clockwise direction is reported as a positive value, and a counterclockwise value is reported as a negative value.
Choose which Gyro/Inertial Sensor to use.
In this example, the Brain’s Inertial sensor will print its starting rotation, set its rotation to -100 degrees, and then print the new heading.
Inertial Sensing#
Acceleration of#
The Acceleration of block is used to report the acceleration value from one of the axes (x, y, or z) on the Inertial Sensor.
The Acceleration of block reports a range from -4.0 to 4.0 Gs.
Choose which Gyro/Inertial Sensor to use.
Choose which axis to use:
x - The X-axis reports acceleration when the Inertial Sensor moves forward to backward.
y - The Y-axis reports acceleration when the Inertial Sensor moves side to side.
z - The Z-axis reports acceleration when the Inertial Sensor moves up to down.
In this example, the Drivetrain will move forward and print its current X-axis acceleration while moving.
Gyro Rate of#
The Gyro Rate of block is used to report the rate of rotation from one of the axes (x, y, or z) on the Inertial Sensor.
The Gyro Rate of block reports a range from -1000.0 to 1000.0 in dps (degrees per second).
Choose which Gyro/Inertial Sensor to use.
Choose which axis to use:
x - The X-axis reports rate of rotation when the Inertial Sensor rotates on the X-Axis (based on the orientation of the sensor).
y - The Y-axis reports rate of rotation when the Inertial Sensor rotates on the Y-Axis (based on the orientation of the sensor).
z - The Z-axis reports rate of rotation when the Inertial Sensor rotates in the Z-Axis (based on the orientation of the sensor).
In this example, the Drivetrain will turn to the right and print its current X-axis gyro rate while turning.
Orientation of#
The Orientation of block is used to report the orientation angle of the inertial sensor.
Choose which Gyro/Inertial Sensor to use.
Choose which orientation to use:
roll - The Y-axis represents roll, which reports a value between -180 to +180 degrees.
pitch - The X-axis represents pitch, which reports a value between -90 to +90 degrees.
yaw - The Z-axis represents yaw, which reports a value between -180 to +180 degrees.
In this example, the Drivetrain will turn to the right and print its current roll as it turns.
Encoder Sensing#
Set Shaft Encoder Position#
The Set Shaft Encoder Position block is used to set the Shaft Encoder’s position to the given value.
Choose which Shaft Encoder to use.
In this example, the Shaft Encoder will print its starting position, set its position to 90 degrees, and then print the new position.
Shaft Encoder Position#
The Shaft Encoder Position block is used to report the distance the Shaft Encoder has rotated.
Choose which Shaft Encoder to use.
Choose which unit to report in: degrees or turns.
In this example, the Shaft Encoder will print its starting position, set its position to 90 degrees, and then print the new position.
Shaft Encoder Velocity#
The Shaft Encoder Velocity block is used to report the current velocity of a Shaft Encoder.
Choose which Shaft Encoder to use.
Choose which unit to report in: degrees per second (dps) or rotations per minute (rpm).
Distance Sensing#
Object Distance#
The Object Distance block is used to report the distance of the nearest object from the Distance Sensor.
The Object Distance block reports a range from 20mm to 2000mm.
Choose which Distance Sensor to use.
Choose what units to report in: millimeters (mm) or inches.
In this example, the Distance Sensor will report the current distance between it and the closest object.
Object Velocity#
The Object Velocity block is used to report the current velocity of an object in meters per second (m/s).
Choose which Distance Sensor to use.
In this example, the Distance Sensor will report the current velocity of an object moving in front of it.
Object Size Is#
The Object Size Is block is used to report if the Distance Sensor detects the specified object size.
The Distance Sensor determines the size of the object detected (none, small, medium, large) based on the amount of light reflected and returned to the sensor.
The Object Size Is block reports True
when the Distance Sensor detects the specified size.
The Object Size Is block reports False
when the Distance Sensor doesn’t detect the specified size.
Choose which Distance Sensor to use.
Choose which size of the object you want the Object Sensor to check for.
small
medium
large
In this example, if the Distance Sensor detects a small object, it will drive forward until the object is large.
Distance Sensor Found Object#
The Distance Sensor Found Object block is used to report if the Distance Sensor sees an object within its field of view.
The Distance Sensor Found Object block reports True
when the Distance Sensor sees an object or surface within its field of view.
The Distance Sensor Found Object block reports False
when the Distance Sensor does not detect an object or surface.
Choose which Distance Sensor to use.
In this example, when the Distance Sensor detects an object, it will print a message to the Brain.
Optical Sensing#
Set Optical Mode#
The Set Optical Mode block is used to set an Optical Sensor to either detect colors or gestures.
By default, an Optical Sensor is set to always detect colors. Before using any Optical Sensor gesture blocks, the Optical Sensor must be set to detect gestures.
Choose which Optical Sensor to use.
Choose whether you want to set the mode of the Optical Sensor to either detect colors or gestures.
In this example, the Optical Sensor is set to detect gestures before waiting until a left gesture is detected to print a message.
Set Optical Light#
The Set Optical Light block is used to set the light on the Optical Sensor to on or off. The light lets the Optical Sensor see objects if it is looking at an object in a dark area.
Choose which Optical Sensor to use.
Choose whether to turn the light on or off.
In this example, the Optical Sensor will turn its light on for two seconds before turning it off.
Set Optical Light Power#
The Set Optical Light Power block is used to set the light power of Optical sensor
The The Set Optical Light Power block block accepts a range of 0% to 100%. This will change the brightness of the light on the Optical Sensor. If the light is off, this block will turn the light on.
Choose which Optical Sensor to use.
In this example, the Optical Sensor’s power light is set to 75% before it waits to detect an object to print a message.
Optical Sensor Found Object#
The Optical Sensor Found Object block is used to report if the Optical Sensor detects an object close to it.
The Optical Sensor Found Object block reports True
when the Optical Sensor detects an object close to it.
The Optical Sensor Found Object block reports False
when an object is not within range of the Optical Sensor.
Choose which Optical Sensor to use.
In this example, the Optical Sensor’s power light is set to 75% before it waits to detect an object to print a message.
Optical Sensor Detects Color#
The Optical Sensor Detects Color block is used to report if the Optical Sensor detects the specified color.
The Optical Sensor Detects Color block reports True
when the Optical Sensor detects the specified color.
The Optical Sensor Detects Color block reports False
when the Optical Sensor doesn’t detect the specified color.
Choose which Optical Sensor to use.
Choose which color the Optical Sensor will check for.
In this example, the Optical Sensor’s will wait until it detects a blue object before printing a message.
Optical Brightness#
The Optical Brightness block is used to report the amount of light detected by the Optical Sensor.
The Optical Brightness block reports a number value from 0% to 100%.
A large amount of light detected will report a high brightness value.
A small amount of light detected will report a low brightness value.
Choose which Optical Sensor to use.
In this example, the Optical Sensor will print the current brightness value to the Brain’s screen.
Optical Hue#
The Optical Hue block is used to report the hue of the color of an object.
The Optical Hue block reports a number value that is the hue of the color of an object. It returns a number between 0 and 359.
The value can be thought of as the location of the color on a color wheel in degrees.
Choose which Optical Sensor to use.
In this example, the Optical Sensor will print the currently seen hue to the Brain’s screen.
Optical Sensor Detects Gesture#
The Optical Sensor Detects Gesture block is used to report whether an Optical Sensor has detected the specified gesture.
Important: The Optical Sensor must first be set to detect gestures using the Set Optical Mode block, otherwise it will not detect any gestures.
The Optical Sensor Detects Gesture block reports True
when the Optical Sensor detects the specified gesture.
The Optical Sensor Detects Gesture block reports False
when the Optical Sensor doesn’t detect the specified gesture.
Choose which Optical Sensor to use.
Choose which gesture the Optical Sensor will check for.
In this example, the Optical Sensor is set to detect gestures before waiting until a left gesture is detected to print a message.
Rotation Sensing#
Set Rotation Sensor Position#
The Set Rotation Sensor Position block is used to set a Rotation Sensor’s current position to a defined value.
The Set Rotation Sensor Position block accepts any positive or negative decimal or integer number.
Choose which Rotation Sensor to use.
In this example, the Rotation Sensor will print its starting position, set its position to -100 degrees, and then print the new position.
Rotation Sensor Angle#
The Rotation Sensor Angle block is used to report the Rotation Sensor’s current angle of rotation in degrees.
The Rotation Sensor Angle block reports values in the range of 0.00 to 359.99.
Choose which Rotation Sensor to use.
In this example, the Rotation Sensor will print its starting rotation.
Rotation Sensor Position#
The Rotation Sensor Position block is used to report the current rotational position of the selected Rotation Sensor.
Choose which Rotation Sensor to use.
Choose what units the position will be reported in: degrees or turns.
In this example, the Rotation Sensor will print its starting position, set its position to -100 degrees, and then print the new position.
Rotation Sensor Velocity#
The Rotation Sensor Velocity block is used to report the current velocity of a Rotation Sensor.
Choose which Rotation Sensor to use.
Choose what units the position will be reported in: revolutions per minute (rpm) or degrees per second (dps).
In this example, the Drivetrain will drive turn to the right for 1 second before its current rotational velocity is printed on the Brain’s screen.
Vision Sensing#
Take Vision Sensor Snapshot#
The Take Vision Sensor Snapshot block is used to take a snapshot from the Vision Sensor.
The Take Vision Sensor Snapshot block will capture the current image from the Vision Sensor to be processed and analyzed for color signatures and codes.
A snapshot is required first before using any other Vision Sensor blocks.
Choose which Vision Sensor to use.
Select which vision signature to use. Vision signatures are configured from the Devices window.
Set Vision Sensor Object Item#
The Set Vision Sensor Object Item block is used to set the object item (of the object you want to learn more information about) out of the number of objects detected.
Choose which Vision Sensor to use.
Vision Sensor Object Count#
The Vision Sensor Object Count block is used to report how many objects the Vision Sensor detects.
The Take Vision Sensor Snapshot block will need to be used before the Vision Sensor Object Count block reports a number of objects.
The Vision Sensor Object Count block will only detect the number of objects from the last snapshot signature.
Choose which Vision Sensor to use.
Vision Sensor Object Exists?#
The Vision Sensor Object Exists? block is used to report if the Vision Sensor detects a configured object.
The Take Vision Sensor Snapshot block will need to be used before the Vision Sensor Object Exists? block can detect any configured objects.
The Vision Sensor Object Exists? block reports True
when the Vision Sensor detects a configured object.
The Vision Sensor Object Exists? block reports False
when the Vision Sensor does not detect a configured object.
Choose which Vision Sensor to use.
Vision Sensor Object#
The Vision Sensor Object block is used to report information about a detected object from the Vision Sensor.
The Take Vision Sensor Snapshot block will need to be used before the Vision Sensor Object Exists? block can detect any configured objects.
Choose which Vision Sensor to use.
Choose which property to report from the Vision Sensor:
width - How wide the object is in pixels, from 2 - 316 pixels.
height - How tall the object is in pixels, from 2 - 212 pixels.
centerX - The center X coordinate of the detected object, from 0 - 315 pixels.
centerY - The center Y coordinate of the detected object, from 0 - 211 pixels.
angle - The angle of the detected object, from 0 - 180 degrees.
AI Vision Sensing#
Take AI Vision Snapshot#
The Take AI Vision Snapshot block is used to capture the current image from the AI Vision Sensor to be processed and analyzed for Visual Signatures.
A Visual Signature can be a Color Signature, Color Code, AprilTag, or AI Classification.
A snapshot is required first before using any other AI Vision Sensor blocks.
Choose which AI Vision Sensor to use.
Select what Visual Signature the AI Vision Sensor should take a snapshot of.
AprilTags.
AI Classifications.
A configured Color Signature or Color Code.
In this example, every .25 seconds, the AI Vision Sensor will take a snapshot of the RedBox color signature.
Then it will check if an object was detected before it will print the the CenterX coordinate of the largest object (indexed at 1) to the Brain’s screen.
AI Classification Is#
The AI Classification Is block is used to report if the specified AI Classification has been detected.
The Take AI Vision Snapshot block is required first for AI Classifications before using the AI Classification Is block.
The Take AI Vision Snapshot block reports True
when the AI Vision Sensor has detected the specified AI Classification.
The Take AI Vision Snapshot block reports False
when the AI Vision Sensor has not detected the specified AI Classification.
Choose which AI Vision Sensor to use.
Choose which AI Classification to detect.
BlueBall
GreenBall
RedBall
BlueRing
GreenRing
RedRing
BlueCube
GreenCube
RedCube
In this example, the AI Vision Sensor will take a snapshot of all AI Classifications before checking if a Blue Ball was detected or not. If a Blue Ball was detected, it will print a message to the Print Console.
Detected AprilTag Is#
The Detected AprilTag Is block is used to report if the specified AprilTag is detected.
The Take AI Vision Snapshot blockis required first for AprilTags before using the Detected AprilTag Is block.
The Detected AprilTag Is block reports True
when the AI Vision Sensor has detected the specified AprilTag.
The Detected AprilTag Is block reports False
when the AI Vision Sensor has not detected the specified AprilTag.
Choose which AI Vision Sensor to use.
In this example, the AI Vision Sensor will take a snapshot of all AprilTags before checking if the AprilTag with the ID “3” was detected. If that specific AprilTag was detected, it will print a message to the Print Console.
Set AI Vision Sensor Object Item#
The Set AI Vision Sensor Object Item block is used to set the object item (of the object you want to learn more information about) from the objects detected. By default, the Object item is set to 1 at the start of a project.
The Take AI Vision Snapshot block is required first before the Set AI Vision Sensor Object Item block can be used.
Choose which AI Vision Sensor to use.
In this example, every .25 seconds, the AI Vision Sensor will take a snapshot of the RedBox color signature.
Then it will check if an object was detected, it will print the the CenterX coordinate of the largest object (indexed at 1) to the Brain’s screen.
AI Vision Sensor Object Count#
The AI Vision Sensor Object Count block is used to report how many objects the AI Vision Sensor detects that match the specified Visual Signature.
A Visual Signature can be a Color Signature, Color Code, AprilTag, or AI Classification.
The Take AI Vision Snapshot block is required first before the AI Vision Sensor Object Count block can be used.
Choose which AI Vision Sensor to use.
In this example, every .25 seconds, the AI Vision Sensor will take a snapshot of the RedBox color signature.
Then it will check if an object was detected before printing how many objects were detected.
AI Vision Sensor Object Exists?#
The AI Vision Sensor Object Exists? block is used to report if the AI Vision Sensor detects a Visual Signature.
A Visual Signature can be a Color Signature, Color Code, AprilTag, or AI Classification.
The Take AI Vision Snapshot block is required first before the AI Vision Sensor Object Exists? block can be used.
The AI Vision Sensor Object Exists? block reports True
when the AI Vision Sensor has detected an object.
The AI Vision Sensor Object Exists? block reports False
when the AI Vision Sensor has not detected an object.
Choose which AI Vision Sensor to use.
In this example, every .25 seconds, the AI Vision Sensor will take a snapshot of the RedBox color signature.
Then it will check if an object was detected before printing how many objects were detected.
AI Vision Sensor Object#
The AI Vision Sensor Object block is used to report information about a specified Visual Signature from the AI Vision Sensor.
A Visual Signature can be a Color Signature, Color Code, AprilTag, or AI Classification.
The Take AI Vision Snapshot block is required first before the AI Vision Sensor Object block can be used.
Choose which AI Vision Sensor to use.
Choose which property to report from the AI Vision Sensor:
width - How wide the object is in pixels, from 0 - 320 pixels.
height - How tall the object is in pixels, from 0 - 240 pixels.
centerX - The center X coordinate of the detected object, from 0 - 320 pixels.
centerY - The center Y coordinate of the detected object, from 0 - 240 pixels.
originX - The X coordinate of the object’s leftmost corner, from 0 - 320 pixels.
originY - The Y coordinate of the object’s leftmost corner, from 0 - 240 pixels.
angle - The angle of the detected Color Code only, from 0 - 360 degrees.
tagID - The detected AprilTag’s identification number.
score - The confidence score (up to 100%) for AI Classifications. This score indicates how confident the model is in the detected AI Classification. A higher score indicates greater confidence in the accuracy of the AI Classification.
In this example, every .25 seconds, the AI Vision Sensor will take a snapshot of the RedBox color signature.
Then it will check if an object was detected before it will print the the CenterX coordinate of the largest object (indexed at 1) to the Brain’s screen.
Arm Sensing#
Can 6-Axis Arm Move to Position#
The Can 6-Axis Arm Move to Position block is used to report if the 6-Axis Robotic Arm is able to reach the specified position.
The Can 6-Axis Arm Move to Position block reports True
when the 6-Axis Arm can reach that position.
The Can 6-Axis Arm Move to Position block reports False
when the 6-Axis Arm can not reach that position.
Choose which 6-Axis Arm to use.
Select which unit to use: millimeters (mm) or inches.
In this example, the 6-Axis Arm will check if it can move to (0, 0, 0) and print that it can not reach the position.
Can 6-Axis Arm Increment Move to Position#
The Can 6-Axis Arm Increment Move to Position block is used to report if the 6-Axis Robotic Arm is able to incrementally move for that distance.
The Can 6-Axis Arm Increment Move to Position block reports True
when the 6-Axis Arm can incrementally move for that distance.
The Can 6-Axis Arm Increment Move to Position block reports False
when the 6-Axis Arm can not incrementally move for that distance.
Choose which 6-Axis Arm to use.
Select which unit to use: millimeters (mm) or inches.
In this example, the 6-Axis Arm will check if it can increment move for 500 millimeters on the Y axis and print that it can’t move for that distance.
Can 6-Axis Arm End Effector Move to Orientation#
The Can 6-Axis Arm End Effector Move to Orientation block is used to report if the 6-Axis Arm’s End Effector can rotate about an axis to a specific orientation.
The Can 6-Axis Arm End Effector Move to Orientation block reports True
when the 6-Axis Arm can rotate about an axis to a specific orientation.
The Can 6-Axis Arm End Effector Move to Orientation block reports False
when the 6-Axis Arm can not rotate about an axis to a specific orientation.
Choose which 6-Axis Arm to use.
Select which axis to use:
pitch - Movement around the Y-axis.
roll - Movement around the X-axis.
yaw - Movement around the Z-axis.
In this example, the 6-Axis Arm will check if the End Effector can point towards the 40 degrees position on the X axis and print if it can or can not.
Can 6-Axis Arm End Effector Incrementally Move to Orientation#
The Can 6-Axis Arm End Effector Incrementally Move to Orientation block is used to report if the 6-Axis Arm’s End Effector can incrementally rotate about an axis its orientation for a specific amount of degrees.
The Can 6-Axis Arm End Effector Incrementally Move to Orientation block reports True
when the 6-Axis Arm can incrementally rotate about an axis for a specific amount of degrees.
The Can 6-Axis Arm End Effector Incrementally Move to Orientation block reports False
when the 6-Axis Arm can not incrementally rotate about an axis for a specific amount of degrees.
Choose which 6-Axis Arm to use.
Select which axis to use:
pitch - Rotation around the Y-axis.
roll - Rotation around the X-axis.
yaw - Rotation around the Z-axis.
In this example, the 6-Axis Arm will check if the End Effector can increment move for 20 degrees on the Z axis and print if it can or can not.
6-Axis Arm is Done?#
The 6-Axis Arm is Done? block is used to report if the 6-Axis Arm has completed moving.
The 6-Axis Arm is Done? block reports True
when the 6-Axis Arm is not moving.
The 6-Axis Arm is Done? block reports False
when the 6-Axis Arm is moving.
Choose which 6-Axis Arm to use.
In this example, the Arm will move to the position (-100, 200, 100) and print its Y coordinate in mm every .25 seconds as it moves, until it is done moving.
6-Axis Arm Position#
The 6-Axis Arm Position block is used to report the current position of the 6-Axis Arm in the specified axis.
Choose which 6-Axis Arm to use.
Choose which axis to report.
Choose which unit to report with: millimeters (mm) or inches.
In this example, the 6-Axis Arm will print its current Z axis position in millimeters to the Print Console.
6-Axis Arm End Effector Orientation#
The 6-Axis Arm End Effector Orientation block is used to report the current orientation of the 6-Axis Arm’s End Effector.
Choose which 6-Axis Arm to use.
Choose which axis to report:
pitch - Rotation around the Y-axis.
roll - Rotation around the X-axis.
yaw - Rotation around the Z-axis.
In this example, the 6-Axis Arm will print the End Effector’s current Y axis orientation in degrees to the Print Console.
Line Tracking Sensing#
Line Tracker Reflectivity#
The Line Tracker Reflectivity block is used to report the amount of light reflected using the Line Tracker Sensor.
Choose which Line Tracker Sensor to use.
In this example, the Line Tracker Sensor will print the current detected reflectivity to the Brain’s Screen.
Light Sensing#
Light Sensor Brightness#
The Light Sensor Brightness block is used to report the amount of light detected by the Light Sensor.
Choose which Light Sensor to use.
In this example, the Light Sensor will print the current detected brightness to the Brain’s Screen.
Potentiometer Sensing#
Potentiometer Angle#
The Potentiometer Angle block is used to report the angular position of the Potentiometer.
Choose which Potentiometer to use.
Choose which unit to report in: percent (%) or degrees.
In this example, the Potentiometer will print its current angular position to the Brain’s Screen.
Accelerometer Sensing#
Accelerometer Acceleration#
The Accelerometer Acceleration block is used to report the acceleration value from one axis on the Analog Accelerometer.
The Accelerometer Acceleration block reports a range from -2.0 G to 2.0 G or -6.0 G to 6.0 G depending upon the jumper setting on the Analog Accelerometer.
Choose which Accelerometer to use.
In this example, the Drivetrain will drive forward for 1 second before its current acceleration is printed on the Brain’s screen.
Range Finder Sensing#
Range Finder Found Object?#
The Range Finder Found Object? block is used to report if the Ultrasonic Range Finder Sensor sees an object within its field of view.
The Range Finder Found Object? block reports True
when the Ultrasonic Range Finder Sensor sees an object or surface within its field of view.
The Range Finder Found Object? block reports False
when the Ultrasonic Range Finder Sensor does not detect an object or surface.
Choose which Ultrasonic Range Finder Sensor to use.
In this example, every .25 seconds the Range Finder will check if it detects an object, and if so, will print the distance between it and the object to the Brain’s Screen.
Range Finder Distance#
The Range Finder Distance block is used to report the distance of the nearest object from the Ultrasonic Range Finder Sensor.
Choose which Ultrasonic Range Finder Sensor to use.
Choose which unit to report in: millimeters (mm) or inches.
In this example, every .25 seconds the Range Finder will check if it detects an object, and if so, will print the distance between it and the object to the Brain’s Screen.
Digital In Sensing#
Digital In#
The Digital In block is used to report if the Digital In signal is high.
The 3-Wire ports function at a 5V logic signal voltage level.
The Digital In block reports True
when the digital input signal is high.
The Digital In block reports False
when the digital input signal is low.
Choose which Digital In device to use.
Digital Out Sensing#
Digital Out#
The Digital Out block is used to set the logic level of a digital out 3-Wire port.
The 3-Wire ports function at a 5V logic signal voltage level.
Choose which Digital Out port to use.
Choose what to output: a low or high digital logic signal.