Programming with LED Controls
This topic describes how to complete the following tasks programmatically.
- Change the colors displayed by the LED in its off and on states
- Setting and obtaining the state of an LED control
Setting and Obtaining the State of an LED Control
Use SetCtrlVal to set the state of an LED. Use GetCtrlVal to obtain the state of an LED.
int ledVal;
SetCtrlVal (panelHandle, PANEL_LED, 1);
GetCtrlVal (panelHandle, PANEL_LED, &ledVal);
Change the Colors Displayed by the LED in its Off and On States
To change the colors displayed by the LED in its off and on states, use SetCtrlAttribute with the ATTR_ON_COLOR and ATTR_OFF_COLOR attributes.
SetCtrlAttribute (panelHandle, PANEL_LED, ATTR_OFF_COLOR, VAL_YELLOW);

SetCtrlAttribute (panelHandle, PANEL_LED, ATTR_ON_COLOR, VAL_BLUE);
