PS4 Light bar colors based upon DS4 battery level

This is an example script on how to change the colors of the DS4 light bar based upon the battery level
Version1
AuthorUK_Wildcats_Fans
Publish DateSat, 31 Oct 2015 - 23:43
Last UpdateSat, 31 Oct 2015 - 23:43
Downloads113
ForumAnnouncement Topic
RATE


3

0

Release Notes: An example script based upon forum topic request
Code: Select all
 
main {
 
    if( get_battery() >= 8 ) { // greater than or equal to 80% battery
        // green
        set_led(LED_1, 0);
        set_led(LED_2, 0);
        set_led(LED_3, 1);
        set_led(LED_4, 0);
    }
 
    if( get_battery() <= 2 ) { // less than or equal to 20% battery
        // red
        set_led(LED_1, 0);
        set_led(LED_2, 1);
        set_led(LED_3, 0);
        set_led(LED_4, 0);
    }
 
    if( get_battery() > 2 && get_battery() <8 ) { // between 20 and 80% battery
        // blue
        set_led(LED_1, 1);
        set_led(LED_2, 0);
        set_led(LED_3, 0);
        set_led(LED_4, 0);
    }
 
}