I would like to flash/pulsate an image according to the heart rate. But I dont know how to use the sine function properly for this. The outcome should be to show and hide an image 80 times a minute if the heart rate is 80 and so on. Any help is highly appreciated !
Cheers, H.
Edit:
I tried (clamp(((cos(#ZHR#)*50)+50),0,100)) where ZHR is my rate, 50 the heigt and 50 the offset. limited with values 0 and 100. I am just not sure how to bring the rate under control so its corresponding to actual bpm
Tested and working fine! Thanks Mike, just replaced 2pi for 6.28
(50+50sin(6.28*#Dsm#*#ZHR#/60))
Note: in watches without sensor the tag returns zero and break the formula, so is better to use a conditional like
$#ZHR#>0?(50+50sin(6.28#Dsm# * #ZHR#/60)):(100-200*((#Dsm#/2)%0.5))$
where if the tag is zero remains a steady half of a second pulse.
Take out the spaces between the tags!!!
I also used a variation for a motorcycle image to let it wheel under certain conditions:)
Rotation: $#WM#==C&&#WFAH#>20?(-30+30sin(2pi*#Dsm#*0.5)):0$
Transparency: $#WM#==C&&#WFAH#>15&&#WFACI#<04?80:0$
Just worked out an expression for a progress bar filling up using the heartrate tag. I don’t really know how I figured it out, but this topic helped me a lot. thank you
I am really new to this, so I just added it to the fill ratio
(clamp((sin((6.28*#Dsm#*#ZHR#)/60)),0,1))
This might be a problem that others are having on the GW4 ( refer: Galaxy Watch 4 Heart Rate Errors ). If so then raising a support request would be a good idea. Even if it has been reported already, I think that the support team still wants to know how widespread an issue is and which watches/phone makes/models are impacted.
Ok good to know. Would you please paste the exact text of the expression you are using or post a link to a face with the issue with inspection mode on and I’ll take a look to see if I can see a problem.
Ok, I’m new to this so I’ll see if I can figure that out. As for the expressions I just copied and pasted each one that was posted above with the exception of the one that said remove the spaces which I did. None of them seemed to work for me.
Ok, I retried all the different formulas on this post again before replying. All but one return with nothing and this one “(clamp((sin((6.28*#Dsm#*#ZHR#)/60)),0,1))” is just a zero and none of them change when the creator is animated (pressing play).
I tried the one you just mentioned and it works for me in Creator. Are you sure that when you paste it into the text field that there are no spaces before or after the expression?
If you publish a test face with the set of expressions in text fields and inspection mode on I’ll take a look - it is a bit hard otherwise for me to think what might be going wrong.
I think I figured out another way using the formula i have to make the time colon blink with the seconds. It seems to work. $floor(#DNOW#/(1000/(#ZHR#/30)))%2=0?100:0$.
If you use a progress bar it goes in fill ratio shield, you can use also a shape unless a progress bar and use different formulas in width or hight shield