Coding with the VEX GO Eye Sensor

The VEX GO Eye Sensor is used to detect if an object is near, and if so, determine the color of that object.

Diagram illustrating coding concepts for VEX robotics, featuring labeled components and flowcharts, designed to assist users in understanding programming techniques in the context of VEX GO tutorials.

Note: in this article, the example projects use two different GO Builds:

  • Code Base - Eye Down GO Build
  • Code Base - Eye Forward GO Build

How the Eye Sensor is Used

Screenshot of a coding tutorial from VEX, illustrating step-by-step instructions for programming with VEX robotics. The image includes code snippets and visual aids to enhance understanding for learners in the GO category.

The VEX GO Eye Sensor is used to detect if an object is near, and if so, determine the color of that object.

Diagram illustrating coding concepts for VEX robotics, part of the 'GO' category in the Coding Tutorials section, showcasing key components and their relationships for programming tasks.

The Eye Sensor must be attached to the Brain before powering the Brain on in order to work properly. If the Eye Sensor is attached or removed after the Brain has already been powered on, the Brain must be power cycled (turned off and then back on) in order for the Eye Sensor to function properly.

The Eye Sensor can detect:

Diagram illustrating coding concepts related to VEX robotics, featuring labeled components and connections, used in the Coding Tutorials section of the GO category.

A certain color.
The Eye Sensor can detect the colors red, green, and blue using the <Detects color> block.

Flowchart illustrating coding concepts for VEX robotics, used in the 'Coding Tutorials' section of the 'GO' category, featuring various programming elements and their relationships.

If an object is present.
The Eye Sensor can detect if an object is close to it using the <Found object> block. This can be used to detect Disks if the Eye Sensor is facing down or detects objects in front of it, such as obstacles or walls.

The Eye Sensor can report:

Diagram illustrating coding concepts related to VEX robotics, featuring labeled components and connections, used in the context of coding tutorials within the GO category.

Brightness levels.
The Eye Sensor can report the brightness level of an object using the (Brightness of) block. This can be used to distinguish between light and dark objects. This can be useful when line-tracking.

Diagram illustrating coding concepts for VEX robotics, featuring labeled components and connections, used in the context of coding tutorials in the GO category.

A hue color value in degrees.
The Eye Sensor can report a hue color value of an object using the (Hue of) block. This can be useful when determining the colors of different objects.

Diagram illustrating coding concepts for VEX robotics, featuring labeled components and connections, relevant to the Coding Tutorials section in the GO category.

The (Hue of) block reports a hue value between 0 - 359 degrees.


Eye Detect Color Example Project

Diagram illustrating coding concepts for VEX robotics, part of the GO category, used in coding tutorials. The image includes labeled components and connections to aid understanding of programming principles.

The code below will drive the Code Base - Eye Down GO Build forward until it detects a red Disk. Once a red Disk is detected, the Code Base will stop driving.


Eye Detect Brightness Example Project

Diagram illustrating coding concepts for VEX robotics, featuring labeled components and connections, relevant to the Coding Tutorials section in the GO category.

The code below will drive the Code Base - Eye Down GO Build until it detects a dark line on the GO Field Tile.

Diagram illustrating the coding process for VEX robotics, featuring labeled components and connections, relevant to the 'GO' category in the Coding Tutorials section.

Once a dark line on the Tile is detected, the Code Base will stop driving.

Diagram illustrating coding concepts for the VEX GO robotics system, featuring labeled components and connections, used in the Coding Tutorials section.

The Monitor Console can be used to see the brightness value changing in real time. This can be used to determine the threshold value of the dark line on the Tile.

For more information about monitoring variable and sensing values in VEXcode GO, view this article.


Eye Detect Object Example Project

Flowchart illustrating the steps for coding tutorials in the GO category, featuring key components and processes involved in programming with the GO language.

The code below will drive the Code Base - Eye Forward GO Build until it detects an object. Once an object is detected, the Code Base will stop driving.


Eye Report Hue Example Project

Diagram illustrating coding concepts for VEX robotics, featuring labeled components and connections, used in the context of coding tutorials in the 'GO' category.

The code below will use the Code Base - Eye Forward GO Build to report the hue color value of different objects.

Diagram illustrating coding concepts for VEX robotics, featuring labeled components and connections, relevant to the 'GO' category in the Coding Tutorials section.

The Print Console can be used to see the hue value changing in real time. This example reported the hue value of a red Disk.

Diagram illustrating coding concepts for VEX robotics, featuring labeled components and flowcharts to aid in understanding programming tutorials.

The value can then be compared to the hue chart.

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: