Torre de señales#
Introducción#
The Signal Tower is a device that uses colored lights to show the robot’s status.
For the examples below, the configured Signal Tower will be named signal_tower_1 and will be used in all subsequent examples throughout this API documentation when referring to SignalTower class methods.
A continuación se muestra una lista de todos los métodos disponibles:
Configuradores: Configure los colores y patrones de las luces de la torre de señalización.
set_color– Sets the pattern for one or all Signal Tower LEDs.set_colors– Sets the state of each Signal Tower LED.
Constructores: Inicialicen y configuren manualmente la torre de señales.
SignalTower– Create a Signal Tower.
Colocadores#
set_color#
set_color sets the light pattern of one or all LEDs on the Signal Tower. These lights can be used to track where the robot is at in a project or to show when certain conditions are met.
Usage:
signal_tower_1.set_color(value, state)
Parámetro |
Descripción |
|---|---|
valor |
The color light to control:
|
estado |
The light pattern to apply:
|
# Set the Signal Tower to start blinking the blue LED
signal_tower_1.set_color(SignalTower.BLUE, signal_tower.BLINK)
set_colors#
set_colors sets the state of each Signal Tower LED. These lights can be used to track where the robot is at in a project or to show when certain conditions are met.
Usage:
signal_tower_1.set_colors(r, y, g, b, w)
Parámetro |
Descripción |
|---|---|
r |
The state for the red light:
|
y |
The state for the yellow light:
|
gramo |
The state for the green light:
|
b |
The state for the blue light:
|
w |
The state for the white light:
|
# Turn on all LEDs
signal_tower_1.set_colors(SignalTower.ON, SignalTower.ON, SignalTower.ON, SignalTower.ON, SignalTower.ON)
# Turn on just the red LED
signal_tower_1.set_colors(SignalTower.ON, SignalTower.OFF, SignalTower.OFF, SignalTower.OFF, SignalTower.OFF)
Constructores#
SignalTower#
SignalTower creates a Signal Tower.
SignalTower(smartport)
Parámetro |
Descripción |
|---|---|
|
The Smart Port that the Signal Tower is connected to, written as |
# Construct a Signal Tower "signal_tower_1" with the
# SignalTower class
signal_tower_1 = SignalTower(Ports.PORT1)