VEX IQ C++ API
Public Member Functions | List of all members
vex::touchled Class Reference

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

Inherits vex::device.

Public Member Functions

 touchled (int32_t index)
 Creates a new touchled sensor object on the port specified in the parameter. More...
 
 ~touchled ()
 
void defaultFade (fadeType setting)
 Sets the default fade time for the touchled sensor. More...
 
bool pressing ()
 Get the pressed status of the touchled device. More...
 
void on (colorHue color, uint32_t brightness=100)
 Turn on the led in the touchled sensor. More...
 
void on (uint32_t hue, uint32_t brightness=100)
 Turn on the led in the touchled sensor. More...
 
void on (uint8_t red, uint8_t green, uint8_t blue, uint32_t brightness=100)
 Turn on the led in the touchled sensor. More...
 
void off ()
 Turn off the led in the touchled sensor. More...
 
void brightness (uint32_t brightness)
 Turn on the led in the touchled sensor, or change current brightness. More...
 
void blink (colorHue color, float onTime=0.25, float offTime=0.25)
 Set the led in the touchled sensor as blinking. More...
 
void blink (uint32_t hue, float onTime=0.25, float offTime=0.25)
 Set the led in the touchled sensor as blinking. More...
 
void blink (uint8_t red, uint8_t green, uint8_t blue, float onTime=0.25, float offTime=0.25)
 Set the led in the touchled sensor as blinking. More...
 
- Public Member Functions inherited from vex::device
 device (int32_t index)
 
 ~device ()
 

Additional Inherited Members

- Protected Attributes inherited from vex::device
int32_t _index
 

Detailed Description

Use this class when programming with the touch LED device.

Constructor & Destructor Documentation

◆ touchled()

vex::touchled::touchled ( int32_t  index)
inline

Creates a new touchled sensor object on the port specified in the parameter.

Parameters
indexto the brain port.

◆ ~touchled()

vex::touchled::~touchled ( )
inline

Member Function Documentation

◆ defaultFade()

void vex::touchled::defaultFade ( fadeType  setting)

Sets the default fade time for the touchled sensor.

Parameters
settingThe type of fade the touchled will use, slow, fast or off

◆ pressing()

bool vex::touchled::pressing ( )

Get the pressed status of the touchled device.

Returns
Returns the state of the touchled device. If it is pressed it will return a one. If unpressed, it will return a zero.

◆ on() [1/3]

void vex::touchled::on ( colorHue  color,
uint32_t  brightness = 100 
)

Turn on the led in the touchled sensor.

Parameters
colorThe color of the led
brightnessThe brightness for the led

◆ on() [2/3]

void vex::touchled::on ( uint32_t  hue,
uint32_t  brightness = 100 
)

Turn on the led in the touchled sensor.

Parameters
hueThe hue of the led
brightnessThe brightness for the led

◆ on() [3/3]

void vex::touchled::on ( uint8_t  red,
uint8_t  green,
uint8_t  blue,
uint32_t  brightness = 100 
)

Turn on the led in the touchled sensor.

Parameters
redThe red value of the led
greenThe green value of the led
blueThe blue value of the led
brightnessThe brightness for the led

◆ off()

void vex::touchled::off ( )

Turn off the led in the touchled sensor.

◆ brightness()

void vex::touchled::brightness ( uint32_t  brightness)

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

Parameters
brightnessThe brightness for the led

◆ blink() [1/3]

void vex::touchled::blink ( colorHue  color,
float  onTime = 0.25,
float  offTime = 0.25 
)

Set the led in the touchled sensor as blinking.

Parameters
colorThe color of the led
onTimeThe time the led should remain on in seconds
offTimeThe time the led should remain off in seconds

◆ blink() [2/3]

void vex::touchled::blink ( uint32_t  hue,
float  onTime = 0.25,
float  offTime = 0.25 
)

Set the led in the touchled sensor as blinking.

Parameters
hueThe hue of the led
onTimeThe time the led should remain on in seconds
offTimeThe time the led should remain off in seconds

◆ blink() [3/3]

void vex::touchled::blink ( uint8_t  red,
uint8_t  green,
uint8_t  blue,
float  onTime = 0.25,
float  offTime = 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
onTimeThe time the led should remain on in seconds
offTimeThe time the led should remain off in seconds