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#

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:

  • none — Turns off the Touch LED
  • red
  • green
  • blue
  • white
  • yellow
  • orange
  • purple
  • red violet
  • violet
  • blue violet
  • blue green
  • yellow green
  • yellow orange
  • red orange
You can also insert the Optical color name and Color color name reporter blocks to make the Touch LED match the color currently detected by the Optical Sensor or Color Sensor.

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:

  • slow
  • fast
  • off – The color changes instantly with no transition. This is the default behavior of the Touch LED.

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:

  • pressed
  • released

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)