线路跟踪器#
介绍#
循线器是一种模拟传感器,它利用红外LED和光传感器来检测前方表面的反射率。它设计用于安装在机器人底盘下方,使机器人能够沿着预先标记的路径行进。
![]()
This page uses line_tracker as the example Line Tracker name. Replace it with your own configured name as needed.
以下是可用方法列表:
reflectivity– Returns anintegerthat represents the amount of light reflected from the surface as a percent.
构造函数 – 手动初始化线路跟踪器。
Line– Create a Line Tracker.
反射率#
reflectivity returns an integer that represents the amount of light reflected from the surface as a percent. This can be used to help a robot follow a pre-marked path.
笔记:
0%反射率意味着物体非常暗。
100%反射率意味着物体非常明亮。
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)