Flash LED cycling RGB colors when charging phone?

Post your questions and help other users.

Moderator: Martin

Post Reply
teiji
Posts: 14
Joined: 25 Nov 2018 19:37

Flash LED cycling RGB colors when charging phone?

Post by teiji » 17 Dec 2018 15:49

Hello, I'm trying to do a fun flow where the flash LED will cycle through the RGB colors (or at least these, in order: red, purple, blue, light blue, green, yellow) when charging the phone. The trigger is when power is connected. For action, I tried creating notification on statusbar (flash LED: red 200ms on, 200ms off), follow by a sleep 200ms action, then another notification on statusbar (flash LED: purple 200ms on, 200ms off), sleep 200ms, etc for the remaining colors. But when I tested it, everything ran so fast and ONLY the last color is flashing (ie. the last notification with LED yellow).

How can I make the LED flashes the different colors in succession and then repeat itself, until I disconnect the phone from the power source?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Flash LED cycling RGB colors when charging phone?

Post by Desmanto » 18 Dec 2018 16:28

The LED doesn't work at mine. Simple notification works by blinking the LED (my phone only has white) without setting the flash LED.

Try to increase the on off period, maybe to 2000 ms. Try also to put action sleep between the notif. You can loop it indefinitely by connecting the last element to the starting notif. To stop the flow, use other flow with trigger power disconnected and action stop flow, choose this looping flow.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

teiji
Posts: 14
Joined: 25 Nov 2018 19:37

Re: Flash LED cycling RGB colors when charging phone?

Post by teiji » 19 Dec 2018 22:54

Thanks. After various trials and errors, I gave up. The LED were flashing sporadically even after setting them seconds apart with my old idea. I've decided to change LED colors base on battery percentage now, and so far it has been working nicely. And more informatively also, since I'll know what % my battery is generally at by looking at the LED color when it is charging.

Post Reply