VEX IQ Python API
Public Member Functions | List of all members
vex.Touchled Class Reference

Use this class when programming with the touch LED device. More...

Inheritance diagram for vex.Touchled:
vex.Device

Public Member Functions

def __init__ (self, index)
 
def default_fade (self, fadeType)
 Sets the default fade time for the touchled sensor. More...
 
def pressing (self)
 Get the pressed status of the touchled device. More...
 
def on (self, color, brightness=100)
 Turn on the led in the touchled sensor. More...
 
def on_hue (self, colorHue, brightness=100)
 Turn on the led in the touchled sensor. More...
 
def on_rgb (self, red, green, blue, brightness=100)
 Turn on the led in the touchled sensor. More...
 
def off (self)
 Turn off the led in the touchled sensor. More...
 
def brightness (self, brightness)
 Turn on the led in the touchled sensor, or change current brightness. More...
 
def blink (self, color, on_time=0.25, off_time=0.25)
 Set the led in the touchled sensor as blinking. More...
 
def blink_hue (self, colorHue, on_time=0.25, off_time=0.25)
 Set the led in the touchled sensor as blinking. More...
 
def blink_rgb (self, red, green, blue, on_time=0.25, off_time=0.25)
 Set the led in the touchled sensor as blinking. More...
 

Detailed Description

Use this class when programming with the touch LED device.

Constructor & Destructor Documentation

◆ __init__()

def vex.Touchled.__init__ (   self,
  index 
)

Member Function Documentation

◆ default_fade()

def vex.Touchled.default_fade (   self,
  fadeType 
)

Sets the default fade time for the touchled sensor.

Parameters
fadeTypeThe type of fade the touchled will use: FadeType.SLOW, FAST or OFF

◆ pressing()

def vex.Touchled.pressing (   self)

Get the pressed status of the touchled device.

Returns
True if pressed, False otherwise

◆ on()

def vex.Touchled.on (   self,
  color,
  brightness = 100 
)

Turn on the led in the touchled sensor.

Parameters
colorcolor value: 0xRRGGBB
brightnessThe brightness for the led

◆ on_hue()

def vex.Touchled.on_hue (   self,
  colorHue,
  brightness = 100 
)

Turn on the led in the touchled sensor.

Parameters
colorHueThe color of the led: ColorHue enum value
brightnessThe brightness for the led

◆ on_rgb()

def vex.Touchled.on_rgb (   self,
  red,
  green,
  blue,
  brightness = 100 
)

Turn on the led in the touchled sensor.

Parameters
redThe red value of the led, 0-255
greenThe green value of the led, 0-255
blueThe blue value of the led, 0-255
brightnessThe brightness for the led, 0-100

◆ off()

def vex.Touchled.off (   self)

Turn off the led in the touchled sensor.

◆ brightness()

def vex.Touchled.brightness (   self,
  brightness 
)

Turn on the led in the touchled sensor, or change current brightness.

Parameters
brightnessThe brightness for the led 0-100

◆ blink()

def vex.Touchled.blink (   self,
  color,
  on_time = 0.25,
  off_time = 0.25 
)

Set the led in the touchled sensor as blinking.

Parameters
colorcolor value: 0xRRGGBB
on_timeThe time the led should remain on in seconds
off_timeThe time the led should remain off in seconds

◆ blink_hue()

def vex.Touchled.blink_hue (   self,
  colorHue,
  on_time = 0.25,
  off_time = 0.25 
)

Set the led in the touchled sensor as blinking.

Parameters
colorHueThe color of the led: ColorHue enum value
on_timeThe time the led should remain on in seconds
off_timeThe time the led should remain off in seconds

◆ blink_rgb()

def vex.Touchled.blink_rgb (   self,
  red,
  green,
  blue,
  on_time = 0.25,
  off_time = 0.25 
)

Set the led in the touchled sensor as blinking.

Parameters
redThe red value of the led 0-255
greenThe green value of the led 0-255
blueThe blue value of the led 0-255
on_timeThe time the led should remain on in seconds
off_timeThe time the led should remain off in seconds