Ojo#
Introducción#
The VEX VR Eye Sensor can detect objects and identify their color, and brightness.
A continuación se muestra una lista de todos los bloques disponibles:
eye near object – Reports whether the Eye Sensor detects an object within range.
eye detects color – Reports whether the Eye Sensor detects a specified color.
eye brightness – Reports the brightness detected by the Eye Sensor.
when eye – Runs the attached stack of blocks when the Eye Sensor detects or loses an object.
eye near object#
The eye near object Boolean block reports whether the Eye Sensor detects an object within range.
True — The Eye Sensor detects an object.
False — The Eye Sensor does not detect an object.
<[FrontEye v] está cerca del objeto?>
Parámetros |
Descripción |
|---|---|
ojo |
El sensor ocular para detectar objetos. |
Ejemplo
cuando empezó
[Stop driving after detecting an object.]
unidad [adelante v]
esperar (0.1) segundos
esperar hasta <[FrontEye v] está cerca del objeto?>
deja de conducir
eye detects color#
The eye detects color Boolean block reports whether the Eye Sensor detects a specified color.
True – The sensor detects the specified color.
False – The sensor does not detect the specified color.
<[FrontEye v] detecta [rojo v]?>
Parámetros |
Descripción |
|---|---|
ojo |
El sensor ocular para detectar colores. |
color |
The color to detect:
|
Ejemplo
cuando empezó
[Stop driving after detecting a green object.]
unidad [adelante v]
esperar (0.1) segundos
esperar hasta <[FrontEye v] detecta [verde v]?>
deja de conducir
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.
([FrontEye v] brillo en %)
Parámetros |
Descripción |
|---|---|
ojo |
El sensor ocular para detectar el brillo. |
Ejemplo
cuando empezó
[Display whether a detected object is bright.]
unidad [adelante v]
esperar hasta <[FrontEye v] está cerca del objeto?>
esperar (0.1) segundos
si <([FrontEye v] brillo en %) [math_less_than v] [70]> entonces
imprimir [Object not bright.] ▶
demás
imprimir [Bright object!] ▶
cuando el ojo#
The when eye hat block runs the attached stack of blocks when the selected Eye Sensor detects or loses an object.
cuando [FrontEye v] [detects v] un objeto :: hat events
Parámetros |
Descripción |
|---|---|
ojo |
El sensor ocular a utilizar. |
estado |
When the attached stack of blocks will run:
|
Ejemplo
cuando [FrontEye v] [loses v] un objeto :: hat events
[Find an object when it is lost.]
turno [derecha v]
esperar hasta <[FrontEye v] está cerca del objeto?>
deja de conducir