
|
Functions related to LEDs
|
|
|
|
|
|
Function Name
|
Description
|
|
Returns the current value of a LED state
|
|
|
Set the state of a LED
|
|
|
Blinks a LED a certain number of times
|
|
|
Checks if a LED is being blinked by the set_ledx function
|
|
|
Reset the LEDs state to what was set by the console
|
|
|
|
|
|
Additional Instructions in this section
|
|
|
|
|
|
Name
|
Description
|
Value
|
|
LED 1 / Xbox 360 Quadrant 1
|
0
|
|
LED 2 / Xbox 360 Quadrant 2
|
1
|
|
LED 3 / Xbox 360 Quadrant 3
|
2
|
|
LED 4 / Xbox 360 Quadrant 4
|
3
|
|
set_led sets the state of an LED on the controller. When an led
state is set, it remains set until such time as the LEDs are reset, it is set again in your GPC script or
the script is unloaded.
An LED
can be set to one of four states using this function which range from 0 ~ 3, as shown in the
table below;
Example
of usage:
Syntaxset_led ( <led_identifier> , <state> );
Parameters<led_identifier> : the identifier of an LED
<state> : Numeric value which represents the state, as shown in the table above
|
|||||||||||
|
set_ledx is used to Blink and LED a set amount of times.
You can blink an led from 0 to 255
times. 0 sets the LED to on.
Example
of usage:
Syntaxset_ledx ( <led_identifier> , <no_of_blinks> );
Parameters<led_identifier> : the identifier of an LED
<no_of_blinks> : The number of times to blink the LED
|
|
|
get_ledx checks to see if an LED is currently being blinked by
the set_ledx function.
Example
of usage:
Syntaxget_ledx ( );
ParametersNone
ReturnsTRUE is the LEDs are being blinked by the set_ledx function, FALSE if they are not
|
|
|
The
Dualshock 4 controller has one lightbar instead of four LEDs. The color of the
lightbar can be controlled by setting all four led states simultaneously.
For
example, the following code will set the lightbar to green;
To save
you from remembering all the different combinations, we have created this script which
simplifies the task of setting the color with a custom function. You can add your own
code to this and use the function to create visual notifications in your GPC script;
|
||