Line Tracker#
Introduction#
The Line Tracker is an analog sensor that uses an infrared LED and light sensor to detect the reflectivity of the surface in front of it. It is designed to be mounted under the chassis of a robot so that the robot can follow a pre-marked path.
![]()
This page uses line_tracker as the example Line Tracker name. Replace it with your own configured name as needed.
Below is a list of available methods:
reflectivity– Returns anintegerthat represents the amount of light reflected from the surface as a percent.
Constructor – Manually initialize a Line Tracker.
Line– Create a Line Tracker.
reflectivity#
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.
Note:
0% reflectivity means the object is very dark.
100% reflectivity means the object is very bright.
Usage:
line_tracker.reflectivity(units)
Parameter |
Description |
|---|---|
|
Optional. The unit to return the reflectivity with: |
Constructor#
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)
Parameter |
Description |
|---|---|
|
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)