Touch LED#
Introduction#
The Touch LED category includes blocks that control and monitor the VEX IQ Touch LED. These blocks allow you to set color, brightness, and fade speed, as well as detect when the Touch LED is being pressed.
Below is a list of all blocks:
set Touch LED color — Sets the Touch LED to a selected color.
set Touch LED fade — Sets how quickly the Touch LED transitions between colors.
set Touch LED brightness — Sets the brightness level of the Touch LED.
Touch LED pressed? — Returns whether the Touch LED is currently being pressed.
when Touch LED — Executes the attached stack of blocks when the Touch LED is pressed or released.
set Touch LED color#
The set Touch LED color block sets the color of the Touch LED using the current transition speed and brightness settings.
establecer el color [TouchLED 1 v] en (none v)
Parameters |
Description |
|---|---|
touch led |
Which Touch LED’s color to set, configured in the Devices window. |
color |
Sets the LED’s color to:
|
Example
cuando empezó
[Blink the TouchLED off and on.]
para siempre
establecer el color [TouchLED 1 v] en (green v)
esperar (0.5) segundos
establecer el color [TouchLED 1 v] en (none v)
esperar (0.5) segundos
cuando empezó
[See what color the Optical Sensor is detecting.]
para siempre
establecer el color [TouchLED 1 v] en ([Optical 1 v] nombre de color)
esperar (0.5) segundos
set Touch LED fade#
The set Touch LED fade block sets how fast the Touch LED will transition between colors.
establecer [TouchLED 1 v] desvanecerse a [slow v]
Parameters |
Description |
|---|---|
touch led |
Which Touch LED’s transition speed to set, configured in the Devices window. |
transition speed |
The speed at which the Touch LED will transition to the next color:
|
Example
cuando empezó
[Slowly fade TouchLED colors.]
establecer el color [TouchLED 1 v] en (green v)
establecer [TouchLED 1 v] desvanecerse a [slow v]
esperar (2) segundos
establecer el color [TouchLED 1 v] en (red v)
set Touch LED brightness#
The set Touch LED brightness block sets the brightness of the Touch LED.
Establezca el brillo [TouchLED 1 v] al (50)%
Parameters |
Description |
|---|---|
touch led |
Which Touch LED’s brightness to set, configured in the Devices window. |
brightness |
The brightness of the Touch LED from 0 to 100 as a percent. |
Example
cuando empezó
[Light up the TouchLED with different brightnesses.]
Establezca el brillo [TouchLED 1 v] al (25)%
establecer el color [TouchLED 1 v] en (green v)
esperar (2) segundos
Establezca el brillo [TouchLED 1 v] al (100)%
Touch LED pressed?#
The Touch LED pressed? block returns a Boolean indicating if a Touch LED is currently being pressed.
True — The Touch LED is being pressed.
False — The Touch LED is not being pressed
<[TouchLED 1 v] presionado?>
Parameters |
Description |
|---|---|
touch led |
Which Touch LED to check, configured in the Devices window. |
Example
cuando empezó
[Change the TouchLED color when it is pressed.]
establecer el color [TouchLED 1 v] en (green v)
esperar hasta <[TouchLED 1 v] presionado?>
establecer el color [TouchLED 1 v] en (blue v)
when Touch LED#
The when Touch LED block runs the attached stack of blocks when the Touch LED is pressed or released.
cuando [TouchLED 1 v] [presionado v]
Parameters |
Description |
|---|---|
touch led |
Which Touch LED to check, configured in the Devices window. |
actions |
Determines when the attached stack of blocks will execute:
|
Example
cuando [TouchLED 1 v] [presionado v]
[Turn green briefly when pressed.]
establecer el color [TouchLED 1 v] en (green v)
esperar [2] segundos
establecer el color [TouchLED 1 v] en (none v)