Titan one DS4 power manage macro?

Titan One general support. Questions, firmware update, feature request.

Titan one DS4 power manage macro?

Postby Ron-Short » Sat Oct 31, 2015 9:55 pm

Is it possible to do this with a titan one?

https://www.youtube.com/watch?v=X-mujcmBH7U
User avatar
Ron-Short
Sergeant First Class
Sergeant First Class
 
Posts: 17
Joined: Wed Oct 21, 2015 2:47 am

Re: Titan one DS4 power manage macro?

Postby UK_Wildcats » Sat Oct 31, 2015 11:42 pm

Yes, it is possible. There is a function that can be used called "get_battery()". It returns a value of 1-10 that represents the batter level - i.e. 1 = 10%, 5 = 50% and 10 = 100%. You can also change the colors of the lightbar.

get_battery documentation
http://www.consoletuner.com/kbase/misc_functions_and_constants.htm#get_battery

PS4 Light Bar script example
http://www.consoletuner.com/gpclib/?s=958

Example script that I created to show how you can use get_battery(). If battery is >= 80% level, the lightbar will be green. If <= 20% battery level, the lightbar will be red. If the battery level is between 20-80%, the lightbar will be blue.
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);
    }

}
User avatar
UK_Wildcats
Brigadier General
Brigadier General
 
Posts: 2243
Joined: Thu Jan 08, 2015 6:53 pm

Re: Titan one DS4 power manage macro?

Postby Ron-Short » Mon Nov 02, 2015 4:54 pm

thanks! this works
User avatar
Ron-Short
Sergeant First Class
Sergeant First Class
 
Posts: 17
Joined: Wed Oct 21, 2015 2:47 am

Re: Titan one DS4 power manage macro?

Postby UK_Wildcats » Mon Nov 02, 2015 6:05 pm

You're welcome. Thank you for testing.
User avatar
UK_Wildcats
Brigadier General
Brigadier General
 
Posts: 2243
Joined: Thu Jan 08, 2015 6:53 pm


Return to Titan One Device

Who is online

Users browsing this forum: astrals and 105 guests