VEX IQ Python API
Public Member Functions | List of all members
vexiq.TouchLed Class Reference

Config Touch Led: detects touch and shines in various colors More...

Public Member Functions

def __init__ (self, port=None)
 
def is_touch (self)
 True if touch is detected, False otherwise. More...
 
def color (self, red, green, blue, brightness=100)
 Set color from components in [0-100] range. More...
 
def brightness (self, value)
 Set brigthness. More...
 
def named_color (self, named_color)
 Set color from the NamedColor value. More...
 
def on (self)
 Turn the LED on with the last set color. More...
 
def off (self)
 Turn the LED off. More...
 
def blink (self, on_time=0.5, off_time=0.5)
 Set the LED to blink in the last set color, given on/off time in seconds. More...
 

Detailed Description

Config Touch Led: detects touch and shines in various colors

Parameters
port1-12, None to autodetect. Default None.

Constructor & Destructor Documentation

◆ __init__()

def vexiq.TouchLed.__init__ (   self,
  port = None 
)

Member Function Documentation

◆ is_touch()

def vexiq.TouchLed.is_touch (   self)

True if touch is detected, False otherwise.

Returns
bool

◆ color()

def vexiq.TouchLed.color (   self,
  red,
  green,
  blue,
  brightness = 100 
)

Set color from components in [0-100] range.

Parameters
red
green
blue
brightnessDefault 100.

◆ brightness()

def vexiq.TouchLed.brightness (   self,
  value 
)

Set brigthness.

in [0-100] range

Parameters
valuebrightness value [0-100]

◆ named_color()

def vexiq.TouchLed.named_color (   self,
  named_color 
)

Set color from the NamedColor value.

Parameters
named_colorNamedColor enum value

◆ on()

def vexiq.TouchLed.on (   self)

Turn the LED on with the last set color.

◆ off()

def vexiq.TouchLed.off (   self)

Turn the LED off.

◆ blink()

def vexiq.TouchLed.blink (   self,
  on_time = 0.5,
  off_time = 0.5 
)

Set the LED to blink in the last set color, given on/off time in seconds.

Parameters
on_timeduration to be on, in seconds. Default 0.5
off_timeduration to be off, in seconds. Default 0.5