眼睛#

介绍#

The VEX VR Eye Sensor can detect objects and identify their color, and brightness.

以下是所有可用模块的列表:

  • 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] 靠近对象?>

参数

描述

眼睛

用于检测物体的眼部传感器。

例子

当开始
[Stop driving after detecting an object.]
驱动 [向前 v]
等待 (0.1) 秒
等到 <[FrontEye v] 靠近对象?>
驱动停止

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] 测得 [红色 v]?>

参数

描述

眼睛

用于检测颜色的眼部传感器。

颜色

The color to detect:

  • red
  • green
  • blue

例子

当开始
[Stop driving after detecting a green object.]
驱动 [向前 v]
等待 (0.1) 秒
等到 <[FrontEye v] 测得 [绿色 v]?>
驱动停止

眼睛亮度#

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] 亮度百分比)

参数

描述

眼睛

用于检测光线亮度的眼部传感器。

例子

当开始
[Display whether a detected object is bright.]
驱动 [向前 v]
等到 <[FrontEye v] 靠近对象?>
等待 (0.1) 秒
如果 <([FrontEye v] 亮度百分比) [math_less_than v] [70]> 那么
打印 [Object not bright.] ▶
否则
打印 [Bright object!] ▶

眼睛#

The when eye hat block runs the attached stack of blocks when the selected Eye Sensor detects or loses an object.

当 [FrontEye v] [detects v] 一个对象 :: hat events

参数

描述

眼睛

要使用的眼部传感器。

状态

When the attached stack of blocks will run:

  • detects – An undetected object is now detected
  • loses – A detected object is now no longer detected

例子

当 [FrontEye v] [loses v] 一个对象 :: hat events
[Find an object when it is lost.]
[右 v] 转
等到 <[FrontEye v] 靠近对象?>
驱动停止