LED#
Introducción#
El robot de codificación VEX AIM cuenta con LED (diodos emisores de luz) programables que cambian de color según las condiciones del proyecto. Estos LED pueden configurarse individualmente o todos a la vez para proporcionar información visual o indicar el estado del robot.
Nombres de LED:
|
|
|
---|---|---|
|
|
|
|
Comportamiento#
on#
on
establece el color de uno o todos los LED del robot.
Uso:
robot.led.on(led, color)
Parámetro |
Descripción |
---|---|
|
The LED or LEDs to turn on. You can use a single LED like |
|
Optional. Sets the LED color. Options include:
|
# Turn LEDs green while the screen is pressed
while True:
if robot.screen.pressing():
robot.led.on(ALL_LEDS, GREEN)
else:
robot.led.on(ALL_LEDS, BLACK)
wait(50, MSEC)
# Turn two LEDs red
robot.led.on((LED3, LED4), RED)
off#
off
apaga uno o todos los LED del robot.
Uso:
robot.led.off(led)
Parámetros |
Descripción |
---|---|
|
The LED or LEDs to turn off. You can use a single LED like |
# Turn the LEDs on for 2 seconds.
robot.led.on(ALL_LEDS)
wait(2, SECONDS)
robot.led.off(ALL_LEDS)
# Turn off half the LEDs
robot.led.on(ALL_LEDS)
wait(1, SECONDS)
robot.led.off((LED3, LED4, LED5))