Sensing#
Brain Sensing#
Reset Timer#
The Reset Timer block is used to reset the IQ Brain’s timer.
reset 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.
when started :: hat events
wait (2) seconds
print (timer in seconds) on [Brain v] ◀ and set cursor to next row
reset timer
print (timer in seconds) on [Brain v] ◀ and set cursor to next row
Timer Value#
The Timer Value block is used to report the value of the IQ Brain’s timer in seconds.
(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.
when started :: hat events
wait (2) seconds
print (timer in seconds) on [Brain v] ◀ and set cursor to next row
reset timer
print (timer in seconds) on [Brain v] ◀ and set cursor to next row
Cursor Column#
The Cursor Column block is used to report the column number of the IQ Brain’s screen cursor location.
(cursor column)
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 print the number of the column the cursor is currently on.
when started :: hat events
print (cursor column) on [Brain v] ◀ and set cursor to next row
Cursor Row#
The Cursor Row block is used to report the row number of the IQ Brain’s screen cursor location.
(cursor row)
The Cursor Row 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 print the number of the row the cursor is currently on.
when started :: hat events
print (cursor row) on [Brain v] ◀ and set cursor to next row
Battery Capacity#
The Battery Capacity block is used to report the charge level of the IQ Brain’s battery.
(battery capacity in %)
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.
when started :: hat events
print (battery capacity in %) on [Brain v] ◀ and set cursor to next row
Controller Sensing#
Controller Pressed#
The Controller Pressed block is used to report if a button on the IQ Controller is pressed.
<Controller [E Up v] 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 R Up button on the controller is pressed.
when started :: hat events
[Don't print the message until the R Up button is pressed.]
wait until <Controller [R Up v] pressed?>
print [R Up Button pressed.] on [Brain v] ◀ and set cursor to next row
Position of Controller#
The Position of Controller block is used to report the position of a joystick on the IQ Controller along an axis.
(Controller [A v] position)
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 C axis of the IQ Controller’s joysticks.
when started :: hat events
print (Controller [C v] position) on [Brain v] ◀ and set cursor to next row
Controller Enable/Disable#
The Controller Enable/Disable block is used to enable or disable Controller configured actions from the Devices menu.
controller [Disable v]
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.
when started :: hat events
Controller [Disable v]
drive [forward v] for (6) [inches v] ▶
Controller [Enable v]
Motor Sensing#
Motor is Done?#
The Motor is Done? block is used to report if the selected IQ Smart Motor or Motor Group has completed its movement.
<[Motor7 v] is done?>
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 IQ 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.
<[Motor7 v] is spinning?>
Position of Motor#
The Position of Motor block is used to report the distance an IQ Smart Motor or the first motor of a Motor Group has traveled.
([Motor7 v] position in [degrees v])
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.
when started :: hat events
[Spin Motor7 forward for 1 second.]
spin [Motor7 v] [forward v]
wait (1) seconds
[Print Motor7's current position in degrees.]
print ([Motor7 v] position in [degrees v]) on [Brain v] ▶
Velocity of Motor#
The Velocity of Motor block is used to report the current velocity of an IQ Smart Motor or the first motor of a Motor Group.
([Motor7 v] velocity in [% v])
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.
when started :: hat events
[Spin Motor 7 forward for 1 second.]
spin [Motor7 v] [forward v]
wait (1) seconds
[Print Motor7's current velocity in rpm.]
print ([Motor7 v] velocity in [rpm v]) on [Brain v] ▶
Current of Motor#
The Current of Motor block is used to report the amount of current a IQ Smart Motor or Motor Group is drawing in amperes (amps).
([Motor7 v] current in [amps v])
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.
when started :: hat events
[Spin Motor7 forward for 1 second.]
spin [Motor7 v] [forward v]
wait (1) seconds
[Print Motor7's current velocity in amps.]
print ([Motor7 v] current in [amps v]) on [Brain v] ▶
Drivetrain Sensing#
Drive is Done?#
The Drive is Done? block is used to report if the Drivetrain has completed its movement.
<drive is done?>
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 Drivetrain’s motors are still moving.
Drive is Moving?#
The Drive is Moving? block is used to report if the Drivetrain is currently moving.
<drive is moving?>
The Drive is Moving? block reports True
when the Drivetrain’s motors are moving.
The Drive is Moving? block reports False
when the Drivetrain’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.
(drive heading in degrees)
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.
when started :: hat events
[Turn towards the right for 1 second.]
turn [right v]
wait (1) seconds
[Print Drivetrain's current heading after 1 second.]
print (drive heading in degrees) on [Brain v] ◀ and set cursor to next row
Drive Rotation#
The Drive Rotation block is used to report the Drivetrain’s angle of rotation.
(drive rotation in degrees)
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.
when started :: hat events
[Turn towards the right for 1 second.]
turn [right v]
wait (1) seconds
[Print Drivetrain's current rotation after 1 second.]
print (drive rotation in degrees) on [Brain v] ◀ and set cursor to next row
Drive Velocity#
The Drive Velocity block is used to report the current velocity of the Drivetrain.
(drive velocity in [% v])
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.
when started :: hat events
[Drive forward for 1 second.]
drive [forward v]
wait (1) seconds
[Print Drivetrain's current velocity after 1 second.]
print (drive velocity in [% v] :: #5cb0d6) on [Brain v] ◀ and set cursor to next row
Drive Current#
The Drive Current block is used to report the amount of current (power) that the Drivetrain is currently using.
(drive current amps)
In this example, the Drivetrain will drive forward for 1 second before its current is printed on the Brain’s screen.
when started :: hat events
[Drive forward for 1 second.]
drive [forward v]
wait (1) seconds
[Print Drivetrain's current after 1 second.]
print (drive current amps :: #5cb0d6) on [Brain v] ◀ and set cursor to next row
Bumper Sensing#
Bumper Pressed#
The Bumper Pressed block is used to report if the Bumper Switch is pressed.
<[Bumper8 v] 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.
when started :: hat events
[Don't print the message until the bumper is pressed.]
wait until <[Bumper8 v] pressed?>
print [Bumper was pressed.] on [Brain v] ▶
Touch LED Sensing#
Touch LED Pressed#
The Touch LED Pressed block is used to report if the Limit Switch is pressed.
<[TouchLED11 v] pressed?>
The Touch LED Pressed block reports True
when the selected Touch LED is pressed.
The Touch LED Pressed block reports False
when the selected Touch LED 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 Touch LED is pressed.
when started :: hat events
[Don't print the message until the Touch LED Sensor is pressed.]
wait until <[TouchLED11 v] pressed?>
print [Touch LED was pressed.] on [Brain v] ◀ and set cursor to next row
Gyro Sensing#
Calibrate Gyro#
The Calibrate Gyro block is used to calibrate the VEX IQ Gyro Sensor is used to reduce the amount drift generated by Gyro Sensor.
The Gyro Sensor must remain still during the calibration process.
calibrate [Gyro5 v] for [2 v] seconds
Choose which Gyro Sensor to use.
Choose how long to calibrate the Gyro Sensor for:
2 seconds
4 seconds
8 seconds
In this example, the Brain’s Gyro Sensor will calibrate for 2 seconds before printing the current heading of the Gyro Sensor.
when started :: hat events
calibrate [Gyro5 v] for [2 v] seconds
print ([Gyro5 v] heading in degrees) on [Brain v] ◀ and set cursor to next row
Set Heading#
The Set Heading block is used to set the Gyro Sensor current heading position to the specified value.
set [Gyro5 v] heading to (0) degrees
The Set Heading block accepts a range of 0.0 to 359.99 degrees.
Choose which Gyro Sensor to use.
In this example, the Brain’s Gyro sensor will print its starting heading, set its heading to 90 degrees, and then print the new heading.
when started :: hat events
print ([Gyro5 v] heading in progress :: #5cb0d6) on [Brain v] ◀ and set cursor to next row
set [Gyro5 v] heading to (90) degrees
print ([Gyro5 v] heading in degrees) on [Brain v] ◀ and set cursor to next row
Set Rotation#
The Set Rotation block is used to set the Gyro Sensor current rotation position to the specified value.
set [Gyro5 v] rotation to (0) degrees
The Set Rotation block accepts any positive or negative decimal or integer number.
Choose which Gyro Sensor to use.
In this example, the Brain’s Gyro Sensor will print its starting rotation, set its rotation to -100 degrees, and then print the new rotation.
when started :: hat events
print ([Gyro5 v] rotation in degrees) on [Brain v] ◀ and set cursor to next row
set [Gyro5 v] rotation to (-100) degrees
print ([Gyro5 v] rotation in degrees) on [Brain v] ◀ and set cursor to next row
Angle of Heading#
The Angle of Heading block is used to report the VEX IQ Gyro Sensor’s current heading in degrees.
([Gyro5 v] heading in degrees)
The Angle of Heading block reports a range from 0.0 to 359.99 degrees.
Choose which Gyro Sensor to use.
In this example, the Brain’s Gyro sensor will print its starting heading, set its heading to 90 degrees, and then print the new heading.
when started :: hat events
print ([Gyro5 v] heading in degrees) on [Brain v] ◀ and set cursor to next row
set [Gyro5 v] heading to (90) degrees
print ([Gyro5 v] heading in degrees) on [Brain v] ◀ and set cursor to next row
Angle of Rotation#
The Angle of Rotation block is used to report the VEX IQ Gyro Sensor’s current rotation in degrees.
([Gyro5 v] 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 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.
when started :: hat events
print ([Gyro5 v] rotation in degrees) on [Brain v] ◀ and set cursor to next row
set [Gyro5 v] rotation (-100) degrees :: #5cb0d6
print ([Gyro5 v] rotation in degrees) on [Brain v] ◀ and set cursor to next row
Rate of Gyro#
The Rate of Gyro block is used to report the VEX IQ Gyro Sensor’s rate of angular velocity.
([Gyro5 v] rate in dps)
The Rate of Gyro block reports a range between 0 to 249.99 dps.
Choose which Gyro Sensor to use.
In this example, the current Gyro Sensor’s rate will be printed to the Brain’s screen.
when started :: hat events
print ([Gyro5 v] rate in dps) on [Brain v] ◀ and set cursor to next row
Color Sensing#
Color Sensor Found an Object#
The Color Sensor Found an Object block is used to report if the VEX IQ Color Sensor detects an object.
<[Color12 v] found an object?>
The Color Sensor Found an Object block reports True
when the Color Sensor detects an object or surface close to the front of the sensor.
The Color Sensor Found an Object block reports False
when the Color Sensor does not detect an object or surface close to the front of the sensor.
Choose which Color Sensor to use.
In this example, when the Color Sensor detects an object, it will print a message to the Brain.
when started :: hat events
[Don't print the message until the Color Sensor detects an object.]
wait until <[Color12 v] found an object?>
print [Color Sensor detected an object.] on [Brain v] ◀ and set cursor to next row
Color Sensor Detects Color#
The Color Sensor Detects Color block is used to report if the VEX IQ Color Sensor detects a specific color.
<[Color12 v] detects [red v] ?>
The Color Sensor Detects Color block reports True
when the Color Sensor detects the selected color.
The Color Sensor Detects Color block reports False
when the Color Sensor detects a different color than the one selected.
Choose which Color Sensor to use.
Choose which color to detect.
In this example, when the Color Sensor detects the color green, it will print the detected color to the Brain.
when started :: hat events
[Don't print the message until the Color Sensor detects an the color green.]
wait until <[Color12 v] detects [green v] ?>
print ([Color12 v] color name) on [Brain v] ◀ and set cursor to next row
Color Sensor Color Name#
The Color Sensor Color Name block is used to report the name of the color detected by the VEX IQ Color Sensor.
([Color12 v] color name)
Choose which Color Sensor to use.
In this example, when the Color Sensor detects the color green, it will print the detected color to the Brain.
when started :: hat events
[Don't print the message until the Color Sensor detects an the color green.]
wait until <[Color12 v] detects [green v] ? >
print ([Color12 v] color name) on [Brain v] ◀ and set cursor to next row
Color Sensor Brightness#
The Color Sensor Brightness block is used to report the amount of light detected by the VEX IQ Color Sensor.
([Color12 v] brightness in %)
Choose which Color Sensor to use.
In this example, the Color Sensor will print the current brightness to the Brain.
when started :: hat events
print ([Color12 v] brightness in %) on [Brain v] ◀ and set cursor to next row
Color Sensor Hue#
The Color Sensor Hue block is used to report the hue of the color detected by the VEX IQ Color Sensor.
The Color Sensor Hue block reports a range from 0 to 360.
([Color12 v] hue in degrees)
Choose which Color Sensor to use.
In this example, the Color Sensor will print the current brightness to the Brain.
when started :: hat events
print ([Color12 v] hue in degrees) on [Brain v] ◀ and set cursor to next row
Distance Sensing#
IQ (1st gen)#
To use the IQ (1st gen) Distance Sensing blocks, you must be using an IQ (1st gen) Distance Sensor.
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.
<[Distance9 v] found an object?>
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 the distance between it and the detected object.
when started :: hat events
[Don't print the message until the Distance Sensor detects an object.]
wait until <[Distance9 v] found an object?>
print ([Distance9 v] distance in [mm v]) on [Brain v] ◀ and set cursor to next row
Object Distance#
The Object Distance block is used to report the distance of the nearest object from the Distance Sensor.
([Distance9 v] distance in [mm v])
The Object Distance block reports a range from 24mm to 1000mm or 1 inch to 40 inches.
Choose which Distance Sensor to use.
Choose what units to report in: millimeters (mm) or inches.
In this example, when the Distance Sensor detects an object, it will print the distance between it and the detected object.
when started :: hat events
[Don't print the message until the Distance Sensor detects an object.]
wait until <[Distance9 v] found an object?>
print ([Distance9 v] distance in [mm v]) on [Brain v] ◀ and set cursor to next row
IQ (2nd gen)#
To use the IQ (2nd gen) Distance Sensing blocks, you must be using an IQ (2nd gen) Distance Sensor.
Object Distance#
The Object Distance block is used to report the distance of the nearest object from the Distance Sensor.
([Distance10 v] object distance in [mm v])
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, when the Distance Sensor detects an object, it will print the distance between it and the detected object.
when started :: hat events
[Don't print the message until the Distance Sensor detects an object.]
wait until <[Distance10 v] found an object?>
print ([Distance10 v] object distance in [mm v]) on [Brain v] ◀ and set cursor to next row
Object Velocity#
The Object Velocity block is used to report the current velocity of an object in meters per second (m/s).
([Distance10 v] object velocity in 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.
when started :: hat events
print ([Distance10 v] object velocity in m/s) on [Brain v] ◀ and set cursor to next row
Object Size Is#
The Object Size Is block is used to report if the Distance Sensor detects the specified object size.
<[Distance10 v] object size is [small v] ?>
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.
when started :: hat events
[Check if the Distance Sensor sees a small object.]
if <[Distance10 v] object size is [small v] ?> then
[If a small object is detected, drive forward.]
drive [forward v]
[Wait until the small detected object is large.]
wait until <[Distance10 v] object size is [large v] ?>
[When the object size is large, stop driving.]
stop driving
end
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.
<[Distance10 v] found an object?>
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 the distance between it and the detected object.
when started :: hat events
[Don't print the message until the Distance Sensor detects an object.]
wait until <[Distance10 v] found an object?>
print ([Distance10 v] object distance in [mm v]) on [Brain v] ◀ and set cursor to next row
Optical Sensing#
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.
set [Optical7 v] light [on v]
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.
when started :: hat events
set [Optical7 v] light [on v]
wait (2) seconds
set [Optical7 v] light [off v]
Set Optical Light Power#
The Set Optical Light Power block is used to set the light power of Optical sensor
set [Optical7 v] light power to (50) %
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.
when started :: hat events
set eye light power to (75) %
[Wait until the Eye Sensor detects an object.]
wait until <eye found an object?>
print [Object detected.] ◀ and set cursor to next row
Optical Sensor Found Object#
The Optical Sensor Found Object block is used to report if the Optical Sensor detects an object close to it.
<eye found an object?>
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.
when started :: hat events
set eye light power to (75) %
[Wait until the Eye Sensor detects an object.]
wait until <eye found an object?>
print [Object detected.] ◀ and set cursor to next row
Optical Sensor Detects Color#
The Optical Sensor Detects Color block is used to report if the Optical Sensor detects the specified color.
<eye detects [red v] ?>
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 will wait until it detects a red color before printing the color on the Brain’s screen.
when started :: hat events
[Wait until the Eye Sensor detects the color red.]
wait until <eye detects [red v] ?>
print [Color red detected.] ◀ and set cursor to next row
Optical Sensor Color Name#
The Optical Sensor Color Name block is used to report the name of the color detected by the VEX IQ Optical Sensor.
([Optical4 v] color name)
The Color Name block reports one the following colors:
red
green
blue
yellow
orange
purple
cyan
Choose which Optical Sensor to use.
In this example, the Optical Sensor will wait until it detects a red color before printing the color on the Brain’s screen.
when started :: hat events
[Wait until the Eye Sensor detects the color red.]
wait until <eye detects [red v]>
print [Color red detected.] ◀ and set cursor to next row
Optical Brightness#
The Optical Brightness block is used to report the amount of light detected by the Optical Sensor.
(eye brightness in %)
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.
when started :: hat events
print (eye brightness in %) ◀ and set cursor to next row
Optical Hue#
The Optical Hue block is used to report the hue of the color of an object.
(eye hue in degrees)
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.
when started :: hat events
print (eye hue in degrees) ◀ and set cursor to next row
Vision Sensing#
Take Vision Sensor Snapshot#
The Take Vision Sensor Snapshot block is used to take a snapshot from the Vision Sensor.
take a [Vision1 v] snapshot of [SELECT_A_SIG v]
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.
set [Vision1 v] object item to (1)
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.
([Vision1 v] object count)
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.
<[Vision1 v] object exists?>
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.
([Vision1 v] object [width v])
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.