LED#
Introduction#
The VEX AIM Coding Robot features programmable LEDs (Light-Emitting Diodes) that can change color based on conditions in a project. These LEDs can be set individually or all at once to provide visual feedback or indicate robot status.
LED Names:
|
|
|
---|---|---|
|
|
|
|
Actions#
on#
on
sets the color of one or all of the robot’s LEDs.
Usage:
robot.led.on(led, color)
Parameter |
Description |
---|---|
|
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
turns off one or all of the robot’s LEDs.
Usage:
robot.led.off(led)
Parameters |
Description |
---|---|
|
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))