Rastreador de línea#

Introducción#

El Line Tracker es un sensor analógico que utiliza un LED infrarrojo y un sensor de luz para detectar la reflectividad de la superficie frente a él. Está diseñado para montarse bajo el chasis de un robot, de modo que este pueda seguir una trayectoria predefinida.

El rastreador de línea VEX.

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

A continuación se muestra una lista de los métodos disponibles:

  • reflectivity – Returns an integer that represents the amount of light reflected from the surface as a percent.

Constructor – Inicializa manualmente un rastreador de línea.

  • Line – Create a Line Tracker.

reflectividad#

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.

Nota:

  • Un 0% de reflectividad significa que el objeto es muy oscuro.

  • Una reflectividad del 100% significa que el objeto es muy brillante.

Usage:
line_tracker.reflectivity(units)

Parámetro

Descripción

units

Optional. The unit to return the reflectivity with: PERCENT (default).

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)

Parámetro

Descripción

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)