# Object as battery indicator

Hello, i’m new to facer and I’ve got a question which could be simple but I can’t get a solution for it. I want use an object as battery level indicator ( a car going left to right). I use the tag for battery percentage on the x position and the object moves. But how do I make the formule for the correct (x) starting position? I tried the x-#BLP# but that doesn’t work.

Ok, allow me to explain:

The first thing you want to do is take measurements:
Where do you want your car to start and where to stop and also what is the distance between those points?

First, you need to get that tag into the 0-1 range, like this:
`(#BLP#/100)`
Now all you need to do is multiply that by the range you want your car to move (let’s say 250 units):
`((#BLP#/100)*250)`
This gives you the formula for moving from point “0” to point “250” with accordance to battery level, but let’s say you want it to start at 38 instead of on 0.
All you need to do is add it:
`(((#BLP#/100)*250)+38)`
Thanks to this start of the range go from 0 to 38 and the end of it goes from 250 to 288.

Now you can do some cleaning inside of that script (I personally use http://www.wolframalpha.com/ especially with more advanced formulas):
`(((#BLP#*5)+76)/2)`

3 Likes

Thanks, not as simple as I thought. Hope I get it to work.

Hmmmm, it doesn’t do the trick. When I use your example formula it places te object outside of the watch and doesn’t move when I use the day slider at the bottom. When I use only the #BLP# tag in the X position it does what I want, but it places the object in the middle of the screen and I want it to start from position 240 on the x-axe.

Read the rest and use the later version.

I maybe misused the quote, offcourse I used (((#BLP#*5)+76)/2) to try. I use the browserversion to design, is there an other? Sorry, I’m new to this, so maybe I ask stupid questions. Thanks for your patience.

By later version I ment:

You should use it instead of:

Becouse the second one is simplified and it will be hard to edit it.

Also now I know where you want it to start I can give you a more personalized version:
`(((#BLP#/100)*120)+240)`
This will go from 240 to 360.

Thanks, gonna try it

What am I doing wrong? Used your tag in de x position with an example picture, but it keeps placing it outside of the watchface.

Can you enable the inspection mode, so I can look under the hood?

Also if you could duplicate that image you want to be moving and place 2 unmoving copies of it in the place you want it to start and in the place where you want it to end?

Inspection is enabled. Placed it in the background I like to use. The idea is that car drives as battery indicator from 100 to 0.

1 Like

OMG the error is so simple!
You used #BLP# which gives back a text-based data (with a % mark at the end), it cannot be used in calculations.
`(((#BLN#/100)*156)+84)`