线路跟踪器#
循线器是一种模拟传感器,它利用红外LED和光传感器来检测前方表面的反射率。它设计用于安装在机器人底盘下方,使机器人能够沿着预先标记的路径行进。
![]()
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:
|
构造函数#
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)
范围 |
描述 |
|---|---|
|
The 3-Wire Port that the Line Tracker is connected to:
|
# Create a Line Tracker in Port A
line_tracker = Line(brain.three_wire_port.a)