LED#
Introduction#
The VEX AIM Coding Robot has six LEDs (Light-Emitting Diodes) around the body of the robot. The LEDs can be set to different colors to give feedback, show a robot status, or make the robot easier to track during a project.
Each LED can be set individually, all LEDs can be set at the same time, or a group of LEDs can be set together using a tuple.
LED names:
|
|
|
|---|---|---|
|
|
|
|
Below is a list of all methods:
Actions — Turn LEDs on or off.
Actions#
on#
on turns on one LED, all LEDs, or a group of LEDs.
Usage:
robot.led.on(led, color)
Parameter |
Description |
|---|---|
|
The LED or LEDs to turn on:
|
|
Optional. The color to set the selected LED or LEDs to:
|
Examples
# 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)
Parameter |
Description |
|---|---|
|
The LED or LEDs to turn off:
|
Examples
# 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))






