Ojo#

Introducción#

The Eye Sensor can detect objects and colors. It can also report how much light reflects back to the sensor and the hue value of the detected color. The Eye Sensor has a light that can be turned on or off to help it see objects and colors more clearly.

A continuación se muestra una lista de todos los bloques disponibles:

fijar la luz de los ojos#

The set eye light stack block turns the Eye Sensor’s light on or off. The light can help the Eye Sensor detect objects and colors more clearly.

establecer luz de ojo [encendido v]

Parámetros

Descripción

estado

The state of the Eye Sensor’s light: on or off.

Ejemplo

cuando empezó
[Continuously blink the light.]
para siempre
establecer luz de ojo [encendido v]
esperar (2) segundos
establecer luz de ojo [apagado v]
esperar (2) segundos

ajuste de la potencia de la luz ocular#

The set eye light power stack block sets how bright the Eye Sensor’s light is. The light can help the Eye Sensor detect objects and colors more clearly.

A higher percentage makes the light brighter. A lower percentage makes the light dimmer.

If the Eye Sensor’s light is off, setting the light power above 0% will turn the light on.

If the Eye Sensor’s light is on, setting the light power at 0% will turn the light off.

Establezca la potencia de la luz ocular al (50)%

Parámetros

Descripción

brillo

The brightness to set the Eye Sensor’s light to, from 0% to 100%. Use whole numbers.

Ejemplo

cuando empezó
[Set the light to different power levels.]
Establezca la potencia de la luz ocular al (25)%
esperar (2) segundos
Establezca la potencia de la luz ocular al (50)%
esperar (2) segundos
Establezca la potencia de la luz ocular al (100)%

eye found an object#

The eye found an object Boolean block reports whether or not the Eye Sensor detects an object within range.

  • True — The Eye Sensor detects an object.

  • False — The Eye Sensor does not detect an object.

<¿El ojo encontró un objeto?>

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

cuando empezó
[Stop driving after detecting an object.]
establecer luz de ojo [encendido v]
unidad [adelante v]
esperar (0.1) segundos
esperar hasta <¿El ojo encontró un objeto?>
deja de conducir

eye detects color#

The eye detects color Boolean block reports whether the Eye Sensor detects a specified color, based on the detected hue value.

  • True – The Eye sensor detects the specified color.

  • False – The Eye sensor does not detect the specified color.

To check the exact hue value detected by the Eye Sensor, use the eye hue reporter block.

<¿El ojo detecta [rojo v]?>

Parámetros

Descripción

color

The color for the Eye Sensor to detect:

  • red – Hue value between 340° and 20°.
  • green – Hue value between 75° and 154°.
  • blue – Hue value between 160° and 254°.

Ejemplo

cuando empezó
[Stop driving after detecting a green object.]
establecer luz de ojo [encendido v]
unidad [adelante v]
esperar (0.1) segundos
esperar hasta <¿El ojo detecta [verde v]?>
deja de conducir

tono de ojos#

The eye hue reporter block reports the hue detected by the Eye Sensor as a number from 0 to 359 degrees.

Hue is a way to describe color using numbers around a color wheel.

Una rueda de color circular que muestra un espectro completo de tonos etiquetados con valores de grados alrededor del perímetro, que aumentan en incrementos de 30 grados desde 0° en la parte superior hasta 360°.

(tono de ojos en grados)

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

cuando empezó
[Display if an object is pink.]
para siempre
borrar todas las filas
si <[290] [math_less_than v] (tono de ojos en grados) [math_less_than v] [350]> entonces
imprimir [Pink!] ▶
esperar (0.1) segundos
demás
imprimir [Not pink!] ▶
esperar (0.1) segundos

eye bright object#

The eye bright object Boolean block reports whether the object detected by the Eye Sensor is bright.

An object is considered bright when it reflects more than 70% brightness back to the Eye Sensor.

  • True — The detected object reflects more than 70% brightness.

  • False — The detected object reflects 70% brightness or less.

This can be used before checking for a color to make sure the object is reflecting enough light for the Eye Sensor to detect the color reliably.

<¿ojo objeto brillante?>

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

cuando empezó
[Display whether a detected object is bright.]
set eye light power to (100) %
unidad [adelante v]
esperar hasta <¿El ojo encontró un objeto?>
esperar (0.1) segundos
si <¿ojo objeto brillante?> entonces
imprimir [Bright object!] ▶
demás
imprimir [Object not bright.] ▶

brillo de los ojos#

The eye brightness reporter block reports how much light is reflected back to the Eye Sensor, as a percentage from 0% to 100%.

A higher percentage means more light is reflected back to the Eye Sensor. A lower percentage means less light is reflected back.

(brillo ocular en %)

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

cuando empezó
[Display whether a detected object is bright.]
Establezca la potencia de la luz ocular al (100)%
unidad [adelante v]
esperar hasta <¿El ojo encontró un objeto?>
esperar (0.1) segundos
si <(brillo ocular en %) [math_less_than v] [70]> entonces
imprimir [Object not bright.] ▶
demás
imprimir [Bright object!] ▶