线路跟踪器#

循线器是一种模拟传感器,它利用红外LED和光传感器来检测前方表面的反射率。它设计用于安装在机器人底盘下方,使机器人能够沿着预先标记的路径行进。

VEX线路追踪器。

This page uses line_tracker as the example Line Tracker name. Replace it with your own configured name as needed.

以下是可用方法列表:

  • reflectivity – Returns the amount of light reflected from the surface.

构造函数 – 手动初始化线路跟踪器。

  • Line – Create a Line Tracker.

反射率#

reflectivity returns the amount of light reflected from the surface as a percent.

Usage:
line_tracker.reflectivity(units)

范围

描述

单位

Optional. The unit to return the reflectivity with:

  • PERCENT (default)

构造函数#

Constructors are used to manually create Line objects, which are necessary for configuring a Line Tracker outside of VEXcode.

Line#

Line creates a Line Tracker.

Usage:
Line(port)

范围

描述

port

The 3-Wire Port that the Line Tracker is connected to:

  • On the V5 Brainbrain.three_wire_port.x where x is the number of the port.
  • On a 3-Wire Expanderexpander.a where expander is the name of the expander instance.

# Create a Line Tracker in Port A
line_tracker = Line(brain.three_wire_port.a)