LED#
Introducción#
El robot de codificación VEX AIM cuenta con seis LED (diodos emisores de luz) distribuidos alrededor de su cuerpo. Estos LED se pueden configurar con diferentes colores para proporcionar información, mostrar el estado del robot o facilitar su seguimiento durante un proyecto.
Cada LED se puede configurar individualmente, todos los LED se pueden configurar al mismo tiempo, o se puede configurar un grupo de LED juntos mediante una tupla.
Nombres de los LED:
|
|
|
|---|---|---|
|
|
|
|
A continuación se muestra una lista de todos los métodos:
Acciones: Encender o apagar los LED.
Comportamiento#
on#
on turns on one LED, all LEDs, or a group of LEDs.
Usage:
robot.led.on(led, color)
Parámetro |
Descripción |
|---|---|
|
The LED or LEDs to turn on:
|
|
Optional. The color to set the selected LED or LEDs to:
|
Ejemplos
# Turn all LEDs green while the screen is pressed
while True:
if robot.screen.pressing():
robot.led.on(ALL_LEDS, GREEN)
else:
robot.led.off(ALL_LEDS)
wait(50, MSEC)
# Turn two LEDs red
robot.led.on((LED3, LED4), RED)
off#
off turns off one LED, all LEDs, or a group of LEDs.
Usage:
robot.led.off(led)
Parámetro |
Descripción |
|---|---|
|
The LED or LEDs to turn off:
|
Ejemplos
# Turn all LEDs on for 2 seconds, then turn them off
robot.led.on(ALL_LEDS)
wait(2, SECONDS)
robot.led.off(ALL_LEDS)
# Turn off half of the LEDs
robot.led.on(ALL_LEDS)
wait(1, SECONDS)
robot.led.off((LED3, LED4, LED5))






