LED#

Introduction#

The VEX AIM Coding Robot features codeable 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.

set LED color#

The set LED color block sets the color of one or all of the robot’s LEDs.

set LED color to green#
    set [lightall v] LED color to [blue v]

Parameters

Description

LEDs

One of the LEDs to set (shown below).

color

Sets the LED color:

  • red
  • green
  • blue
  • white
  • yellow
  • orange
  • purple
  • vcyan
  • 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 the location of all six LEDs, clockwise at 1, 3, 5, 7, 9 and 11 o’clock positions.
ALL

Example

when started, if the screen is pressed, set all LEDs color to green#
    when started :: hat events
    [Turn 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