VEXcode IQ C++ Unofficial documentation for version 3.0.4.1
Loading...
Searching...
No Matches
vex::touchled Class Reference
Inheritance diagram for vex::touchled:
vex::device

Public Member Functions

 touchled (int32_t index)
 Creates a new touchled sensor object on the port specified in the parameter.
 
bool installed ()
 
int32_t value ()
 Gets the value of the touchled sensor.
 
void on (colorType color, uint32_t brightness=100)
 Turn on the led in the touchled sensor.
 
void on (uint32_t hue, uint32_t brightness=100)
 Turn on the led in the touchled sensor.
 
void on (uint8_t red, uint8_t green, uint8_t blue, uint32_t brightness=100)
 Turn on the led in the touchled sensor.
 
void off (void)
 Turn off the led in the touchled sensor.
 
void setColor (colorType color)
 
void setFade (fadeType setting)
 Sets the default fade time for the touchled sensor.
 
void setBrightness (uint32_t brightness)
 Turn on the led in the touchled sensor, or change current brightness.
 
void setBlink (colorType color, double onTime=0.25, double offTime=0.25)
 Set the led in the touchled sensor as blinking.
 
void setBlink (uint32_t hue, double onTime=0.25, double offTime=0.25)
 Set the led in the touchled sensor as blinking.
 
bool pressing ()
 Get the pressed status of the touchled device.
 
void pressed (void(*callback)(void))
 Calls a function when the touchled is pressed.
 
void released (void(*callback)(void))
 Calls a function when the touchled is released.
 
- Public Member Functions inherited from vex::device
 device (int32_t index)
 
IQ_DeviceType type ()
 
int32_t index ()
 
void init (int32_t index)
 
int32_t readDigitalPin ()
 
int32_t readAnalogPin ()
 

Additional Inherited Members

- Protected Member Functions inherited from vex::device
void setPollInterval (int32_t value)
 
bool pollValid (bool bSave)
 
- Protected Attributes inherited from vex::device
int16_t _index
 

Detailed Description

Definition at line 26 of file vex_touchled.h.

Constructor & Destructor Documentation

◆ touchled()

vex::touchled::touchled ( int32_t index)

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

Parameters
portindex to the brain port.

Member Function Documentation

◆ installed()

bool vex::touchled::installed ( )
virtual

Reimplemented from vex::device.

◆ on() [1/3]

void vex::touchled::on ( colorType 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

◆ pressed()

void vex::touchled::pressed ( void(* callback )(void))

Calls a function when the touchled is pressed.

Parameters
callbackA reference to a function.

◆ 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.

◆ released()

void vex::touchled::released ( void(* callback )(void))

Calls a function when the touchled is released.

Parameters
callbackA reference to a function.

◆ setBlink() [1/2]

void vex::touchled::setBlink ( colorType color,
double onTime = 0.25,
double 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

◆ setBlink() [2/2]

void vex::touchled::setBlink ( uint32_t hue,
double onTime = 0.25,
double 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

◆ setBrightness()

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

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

Parameters
brightnessThe brightness for the led

◆ setFade()

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

Sets the default fade time for the touchled sensor.

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

◆ value()

int32_t vex::touchled::value ( )
virtual

Gets the value of the touchled sensor.

Returns
Returns an integer that represents whether the touchled is pressed of not

Reimplemented from vex::device.


The documentation for this class was generated from the following file: