Detección de objetos#

Detecting Objects

This tutorial walks you through using the Eye Sensor to detect an object. By the end, you’ll have a project that prints a message once an object is detected.

  1. Make sure your robot has an Eye Sensor connected. See Configuring Devices if you haven’t added one yet.

  2. Attach a wait until block below the when started block.

An empty wait until block, below when started.#
cuando inicie :: hat events
esperar hasta <>
  1. Drag the Eye Sensor’s found an object? Boolean block into the wait until block’s condition slot.

Wait until the Eye Sensor detects an object.#
cuando inicie :: hat events
esperar hasta <¿sensor encontró un objeto?>
  1. Attach a print block below the wait until block.

The print block, below wait until.#
cuando inicie :: hat events
esperar hasta <¿sensor encontró un objeto?>
imprimir [VEXcode] ▶
  1. Change its text to Object detected!.

Screenshot of the finished project, with the print block's text set to Object detected!.
  1. Make sure your robot is connected to VEXcode. See Connecting to Your Robot if it isn’t connected yet.

Screenshot of the VEXcode GO toolbar, showing the Connect button in a Connected state.
  1. Select Start to run the project, then hold an object in front of the Eye Sensor. Once it’s detected, Object detected! will print to the Console.

Screenshot of the VEXcode GO toolbar, with the Start button highlighted.