Smart Port Devices#
Smart Port Devices connect directly to the IQ (2nd gen) Brain through its Smart Ports. These devices expand your robot’s capabilities by enabling sensing, motion control, and advanced feedback systems.
Smart Port sensors provide real-time environmental and motion data that your robot can use for decision-making and control. They are accessed through the sonar, distance, optical, aivision, vision, bumper, touchled, gyro, and colorsensor classes:
Distance Sensor - Measure the distance to nearby objects with the Distance Sensor (1st gen) or (2nd gen), and detect a nearby object’s velocity and size with the (2nd gen) sensor.
Optical Sensor - Detect nearby objects and identify their color, hue, and brightness, control the sensor’s light, and run functions when an object is detected or lost.
AI Vision Sensor - Detect Color Signatures, Color Codes, AprilTags, and AI Classifications with a VEX IQ AI Vision Sensor.
Vision Sensor - Take snapshots to detect and track configured Color Signatures and Color Codes, and read each detected object’s position, size, and angle.
Bumper Switch - Detect when the Bumper Switch is being pressed, and run functions when it is pressed or released.
Touch LED - Detect when the Touch LED is pressed or released, run functions in response, and set its color, brightness, fade speed, and blinking pattern.
Gyro Sensor - Calibrate the sensor, track the robot’s heading and total rotation, reset those values to new references, and measure how fast the robot is turning.
Color Sensor - Detect nearby objects, check for specific colors, read the detected color’s name, hue, and brightness, and control the sensor’s light.
In addition to the devices listed above, IQ Smart Motors and Pneumatic Solenoids also connect through Smart Ports. See the Motion page for those APIs.