Battery graph problems

I’m trying to program a 5-led accent that would work in two stages. When the saber is on, it would fade into a white rotating section. When off, and this is the part i can’t figure out, I’d like it to be a rising bar graph that displays a single color (this would be set to the blade color) where either the max height of the bar graph indicates the battery level, or where the brightness of the color does.

Another thing that has me stumped - I’m currently using this code from Fett’s style generator, which gives me the bar graph without the battery info, but it only stays on for 6 seconds or so.

StylePtr<Layers<Mix<LinearSectionF<Saw<Int<200>>,Int<3000>>,Black,RgbArg<BASE_COLOR_ARG,Rgb<255,255,255>>>,InOutTrL<TrFadeX<BendTimePowInvX<IgnitionTime<1000>,Mult<IntArg<IGNITION_OPTION2_ARG,10992>,Int<98304>>>>,TrFadeX<BendTimePowInvX<RetractionTime<1000>,Mult<IntArg<RETRACTION_OPTION2_ARG,10992>,Int<98304>>>>,TransitionLoop<Black,TrConcat<TrWipe<1000>,RgbArg<OFF_COLOR_ARG,Rgb<255,0,0>>,TrWipeIn<1000>>>>>>(),

I think I figured out why it’s shutting off anyway. it’s powered off the 5v, which is apparently shutoff after a few seconds.

Sound like you have #define IDLE_OFF_TIME, as that will turn the blade Off and end your effect after whatever time it’s set for. You’ll want to increase if you’re wanting the Off effect to last longer.

You can choose “Battery Percent Rising Bar Graph” in Off Behavior (OS7 Library) for the effect you’re after. Just set the Color to Base Color to match your main blade color. You may need to refresh the page if it’s not in dropdown.

You’ll need to have it run from an LED pad to run while off.

I’ll try that.

as far as the wiring, it’s running off the 5v pad for positive and is on an led pad like the rest of the blades. so it should behave the same as the rest normally. i think the 5v is just shutting off with the booster poweroff. i’ll have to power it from the battery - normally i would but i forgot while i was wiring the damn thing.

w/r/t the style - the battery bar graph works, but is there a way to make it pulse dim to full or something similar rather than display fully static?

In my Early Access library you can apply a “Dim Pulse” Color Type, otherwise you’ll need to manually mod the code to do it.