Hi phantasico
no unfortunately does not work
Oh, yes, i forgot the spaces…
This is the right one:
$ #BLN#<=20 && #BLN#>=0? (100 * (sin(((#DWE# / 0.5-(floor(#DWE# / 0.25))) * 2 * pi)))) : 0$
No sorry no red colour and no blinking
I mean the image is not displayed and so of course it cannot blink
Hmmm - can´t be …
i do use exactly this formula in one of my watch faces …
$ #BLN#<=20 && #BLN#>=0? (100 * (sin(((#DWE# / 2-(floor(#DWE# / 1))) * 2 * pi)))) : 0$
now i have copied it from your watch and it works.
Thanks alot.
you are really fantastic
You´re welcome. Glad that it´s working for you now.
I think it was only a display problem here in the community fields.
Greetz, GAUSS.
You paste the code in the opacity line on the right side, when you open the additional window with the small rocket below.
Alternatively you could use the squareWave () function.
This does most of the work for you to get the blinking effect (combined with a conditional statement as provided by @GAUSS of course to only trigger the effect when battery is low)
See Expressions | Facer Documentation.
I used (squareWave(#Dsm#,100,1,0)) in the opacity field for my beer glass face to blink the colon between the hours & minutes (web preview depends on your browser and machine, so does not always look nice, but it works 100% as intended on the watch).
Actually I am alternating it between white and orange, each colour displaying for half a second, so am using 2 layers, with out of phase square waves.
The face is open for inspection if you want to have a look.
PS: I am a relative noob to Facer, so don’t assume that all in my faces is best practice.
The experts are welcome to correct me where required and/or comment on my faces with suggestions to improve (excluding my graphics - I know that is bad… )
Haha, looks great!
Hi @GAUSS
Is it also possible to made the image appears only when it reaches its low batter threshold.
You mean have the blinking image (layer) only visible under specific conditions?
If the expression provided above:
$ #BLN#<=20 && #BLN#>=0? (100 * (sin(((#DWE# / 2-(floor(#DWE# / 1))) * 2 * pi)))) : 0$
is placed in the opacity field, it should do that.
i.e. the layer will only show (blinking) if battery level is between 0 and 20 %
else the opacity will be 0 and thus the image will not show.
Just to feedback on this issue. I did exactly as mentioned above, but the image (layer) is still visible at all times and does not blink when it reaches the low battery threshold. However, the image did not show up in the Face Creator itself. Queer. Or is there other things I need to do as well.
Hi
A while back @mikeoday helped me with the blinking battery feature
I use one of these two formulas in the opacity field:
- $#BLN#<=15?(1*sin(#DWFSS#, 0, 2, 2)*100):0$
- $#BLN#<=15?((floor(#DNOW#/1000)%2)*100):0$
These formulas will make it flash at 15% every 1 second, change the “15” for a different percentage
In the second formula; the “1000” will make it flash every 1 second, for slower increase the 1000 value
Ihope this is what you are looking for
Hi @ozarour
I tried both formulas. Appears that only the 2nd formula $#BLN#<=15?((floor(#DNOW#/1000)%2)*100):0$ works for me. Anyway, Many Thanks.
Glad to hear it works… you are welcome
Hello Phantasico,
I see that you use “&&” for “and” condition. If I am not wrong, this is not mentioned in the Facer documentation. As I din’t know that (I am quite new to Facer); I was struggling to obtain a double condition, using 2 embedded conditions “if… then…”.
Can you tell me if we also have as well an “or” condition, and what it is?
If it is not in the documentation, it would be great to add it (unless I miss it, if so, sorry for this post).
Thanks
Hi, i am not very fit in scripting. Mostly i am learning by inspecting open watch faces. Just had a look and you seem to be right that it´s missing in the documentation.
Maybe you should ask the math cracks in here.
“&&” for sure is “and”
“||” is a form of “or” but i don´t know exactly if it is what you are looking for.
Example:
TRANS: $((#DH# * 100) + (#Dm#)) == 1200 || ((#DH# * 100) + (#Dm#)) == 1530? 100 : 0$
This will make an item visible at 2 different times.
You will find the “or” as well in the conditionals.
I hope this will help you a little bit.
Greetings, GAUSS.
The boolean operators are documented, although very cryptic…
Note that you can have max 3 conditions for a single if test.
You can do: if this then that ,else if this then that etc but there are several restrictions on using this and things don’t always work like you would expect.
Official documented is limited and what works seems to vary between the Facer fields…
The best info is on this forum; you just need to find it.
See threads that I have found on the topic below; I am sure there are more: