LED Functions
Last updated
Last updated
set_led
sets the state of an LED on the controller. The LEDs range from 0 to 3. Four constants have been created to make it easier to remember which value is assigned to which LED:
An LED can be set to one of four states using this function which range from 0 to 3, as shown in the table below:
set_led( <led_identifier>,<led_state>);
<led_identifier> : the LED identifier. <led_state> : the state identifier of the controller LED.
None
get_led returns a value in the form of an int which represents the current state of the chosen LED. The return value from this function informs you of the current state of the selected LED. The function returns a value ranging from 0 ~ 3;
Example of usage:
get_led ( <Led_Identifier> );
<Led_Identifier> : The identifier of an LED
An int ranging from 0 ~ 3 which represents the current state
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:
set_ledx ( <led_identifier> , <no_of_blinks> );
<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:
get_ledx ( );
None
TRUE is the LEDs are being blinked by the set_ledx function, FALSE if they are not
reset_leds returns control of the LEDs to the console and disables any current LED states which are being set by the Virtual Machine.
Example of usage:
reset_leds ( );
None
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.
get_ps4_lbar
gets the playstation 4 lightbar led state from the console.
get_ps4_lbar(State, Range, Color)
There is 3 Colors: PS4_RED, PS4_GREEN, and PS4_BLUE. They have a range from 0 - 255 ( Lower the number equals less brightness, higher the number equals more brighter ).
Example:
set_ps4_lbar
sets the playstation 4 lightbar led state on the controller and sets the color that will be sent to the controller.
There is 3 Colors: DS4_RED, DS4_GREEN, and DS4_BLUE. They have a range from 0 - 255 ( Lower the number equals less brightness, higher the number equals more brighter ).
Example:
Example using both:
Function Name
Description
Zen
Plus
Sets the state of the LED on a controller
✔️
✔️
Gets the state of the LED on a controller
✔️
✔️
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
✔️
✔️
Gets ps4 indication bar color
✔️
❌
Sets ps4 indication color
✔️
❌
Name
Description
Value
LED_1
LED 1 / Xbox 360 Quadrant 1
0
LED_2
LED 2 / Xbox 360 Quadrant 2
1
LED_3
LED 3 / Xbox 360 Quadrant 3
2
LED_4
LED 4 / Xbox 360 Quadrant 4
3
Value
Description
0
LED Off
1
LED On
2
LED Blink Fast
3
LED Blink Slowly
Return Value
Description
0
LED Off
1
LED On
2
LED Blinking Fast
3
LED Blinking Slowly