PS4 Controller Light Bar turns red when Rumble is activated
This script makes the PS4 (or Dualshock 4) Controller Light Bar turn red when the rumble is activated. The default color is Green but both colors can be changed. UPDATE 1.10 | Fixed PS4 Light bar flashing when rumble is active | Fixed Title | Fixed Description
|
RATE
|
Release Notes: +Fixed Light not working properly +Fixed Title +Fixed Description
- Code: Select all
// GPC Online Library
// ps4_controller_light_turns_red_when_rumble.gpc
main {
if(get_rumble(RUMBLE_A)) {
set_led(LED_1, 0);
set_led(LED_2, 1);
set_led(LED_3, 0);
set_led(LED_4, 0);
} else {
set_led(LED_1, 0);
set_led(LED_2, 0);
set_led(LED_3, 1);
set_led(LED_4, 0);
}
if(get_rumble(RUMBLE_B)) {
set_led(LED_1, 0);
set_led(LED_2, 1);
set_led(LED_3, 0);
set_led(LED_4, 0);
} else {
set_led(LED_1, 0);
set_led(LED_2, 0);
set_led(LED_3, 1);
set_led(LED_4, 0);
}
}