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, or all LEDs can be set at the same time.

Below is a list of all blocks:

Action — Set LED color.

Actions#

set LED color#

The set LED color stack block sets the color of one LED or all LEDs on the robot.

set LED color stack block#
    set [lightall v] LED color to [blue v]

Parameter

Description

LEDs

The LED or LEDs to set. Choose LED 1, LED 2, LED 3, LED 4, LED 5, LED 6, or All LEDs. See the LED options below.

color

The color to set the selected LED or LEDs to:

  • red
  • green
  • blue
  • white
  • yellow
  • orange
  • purple
  • cyan
  • off

A top down icon of the robot with a fan emerging from the location of the LED at the 11 o’clock position.
LED 1

A top down icon of the robot with a fan emerging from the location of the LED at the 9 o’clock position.
LED 2

A top down icon of the robot with a fan emerging from the location of the LED at the 7 o’clock position.
LED 3

A top down icon of the robot with a fan emerging from the location of the LED at the 5 o’clock position.
LED 4

A top down icon of the robot with a fan emerging from the location of the LED at the 3 o’clock position.
LED 5

A top down icon of the robot with a fan emerging from the location of the LED at the 1 o’clock position.
LED 6

A top down icon of the robot with fans emerging from all six LED locations.
All LEDs

Example

When started, turns all LEDs green while the screen is pressed.#
    when started
    [Turn all LEDs green while the screen is pressed.]
    forever
        if <screen pressed?> then
            set [lightall v] LED color to [green v]
        else
            set [lightall v] LED color to [off v]
        end
    end