[Watchface] NEW - code tweaking question

Hi peeps, My first COG face.

Tried to help myself with this one by tweaking some previous HR code from Mike. But i’ve screwed something up somewhere.

(clamp((-150+((#ZHR#-50)/(170-50))*(-30-(-150))),-150,-30))

So i’d like the Heart rate needle to start at where 7pm would be and end where 11pm would be. As per the tick marks in my example. And the range to be clamped from 50bpm to 170bpm. What have i got wrong.

Also the cogs are place holders and are not yet moving as i’d like with exception to theone attached to the hand which replicates the hand movements. So its effectivly a hand in the shape of a cog too. But the others i need to tweak so they rotate in both directions.

At the moment the inner cogs are all on this code. So i need to revers that. But if i could be really clever can they spin according to my BPM?

As for the overall design, i’m kind of making it up as i go.

1 Like

Looking good!

You could try:

(clamp(210+((#ZHR#-50)/(170-50)*(330-210)),210,330))

1 Like

Thanks Mike, But that didnt relly do much. it maxes in the right place and at 170bpm bu the minimum ive seen is 70bpm and it doesnt quite dop down to the minimum angle?

Mmm, strange. Perhaps the BPM in Facer Creator does not drop below 70. Have you tried putting a text field in there to display the value of ZHC - this would confirm that the hand is showing the correct value.

edit:

Given that your BPM and angle ranges are numerically identical, the formula can be simplified to:

clamp(160+#ZHR#,210,330)

Yeah there is a text field there mate, i just had it hidden. facer def goes lower becaued my other faces all go down to 50 with the code you provided before. I’ll keep playing and try the new code above. Thank you.

Nope this code just clamps it at 12 oc clock and doesnt move.

Did you put the expression in brackets?

Here is a link to a test watch, it seems to work ok:

very confused now lol, How do I allow inspection on mine without publishing it?

ignore that, found it. Inspection is enabled. Ignore the chaos, I’ll tidy it all up near completion.

Go the front page of Creator ( the one that shows images of all your faces ), click on the three dots next to your draft face and select enable inspection in the drop down.

Click to edit the watch.

From the editor click on the right arrow ( bottom right of screen ) to preview watch.

Copy the full address from the page and post in the forum.

Thought thats what I had posted at the top? Here you go >

1 Like

Ok, the hand seems to be working … I assume that the random BPM in creator does not get low enough to show your minimum value. I suppose you could try testing it by loading it to your watch, sit really still with nice drink and think calm thoughts :slight_smile:

1 Like

Calm lol, Work is stressing me out, this place is my escape . Ok watch loaded and thinking calm thoughts :slight_smile:

1 Like

I hadnt considered it being actually ok, but a random generator issue. You know how difficult it is sitting here trying to ge tmy heart tate to drop below 70 :smiley:

1 Like

You could try closing your eyes and counting sheep.

Or maybe a larger drink.

:slight_smile:

Lol, whilst I wait, would you mind exlaining the your code please. I copy and paste code guides into a notepad for future refference.

Yes it does indeed work, just dropped (my real HR thats is) to 67. Thank you

Right now I need to learn some fancy alternative Cog rotations before tidying the whole thing up lol

Can i breathe again now !

Yes I checked the code. I created a test watch with inspection mode enabled ( link above ). It seems to work.

1 Like

I uploaded my test watch and it is showing

61 BPM
221 Deg

1 Like