Limit Min-max range of Tag and convert to degrees

Hi I’ve designed a custom watchface that uses the [HR] tag for an “analog pulse meter” gauge.

However, My scale goes from 40-200 bpm, and my gauge goes from 0-60 degrees(12-72 in the actual angle field)

As the title suggests I am struggling to get find a way to limit the HR range to 40-200 bpm while contraining it to a 60 degree range.
My only semi “functional” attempt was ([HR>40])*([HR])/3.33333.
The logic was that anything below 40 would be multiplied by 0 and anything above 40 would be multiplied with 1, to start the scale from 40bpm. I divided it by 3.3333 because that was the magic number that made 200bpm line up with the correct notch on the scale. ( I am no expert at math, I just fool around)

It was only correct in 2 positions: 40bpm(12 degrees) and 200bpm(72 degrees). At 41bpm however, the scale jumps to 24.3 degrees, which is 70’ish bpm on the scale, so it somehow remembers how much it “should have moved” if there was no less than sign…

all examples on the wiki are Booleans, but I can’t find examples of gradual change.

Here’s the pulse gauge
image

Hope someone can help me out with this.

1 Like

Ha Ha . Welcome @Damien Even a stopped clock is right Twice a Day . I can not help more than point you in a Direction . I am in Bed right now . I will make a test when I get up . I think you need to look at CLAMP() . It ignores numbers outside the range you set . Easy for me to say . But once you have learned how to use it you will be Delighted . I am not a Mathematician I went to the School of Copy and Paste , College of Trial and Error . The only let me in at the University as a Technician for a few Weeks .
Nice Idea BTW . I love Analogue .
More soon .
.
.
My Formula would be .
((((clamp([HR],40,200))/160)*60)-3)
.
.
Here is the test I made .
Delete the .ZIP part of the File name and you can open it in your WFS .
.
.
CLAMP_ANALOG_TEST.wfs.ZIP (276.8 KB)
.
.

1 Like

Thanks for the input. We’re all pupils in the school of life.

I tried clamping HR earlier as that was my first idea, but all I seemingly got was the median. I will try your solution though. I’ll give an update on my progress once I’ve tested it.

Edit: tested it and I’m really happy with the result. Thanks a lot!
After looking at the formula it makes a lot more sense now. One thing I don’t understand though is why you subtract by -3 by the end?

1 Like

You will see from the Formula test that the clamped HR starts at 40 but is 40 before anthing happens so there is a little compensation for thstarting angle . Did you open the Test . I put Formulas in text boxes a lot . Yes every Day is a Learning Day .

Unfortunately WFS couldn’t recognize the file in the file browser for some reason. seems to register as a zip file on my computer instead of a .Wfs

1 Like

Did you delete the “.ZIP” bit . It will then open itself in WFS . not a Browser . Only delete .ZIP .

Why don’t you set the angle directly to the start angle, in your example 12 degrees, and then subtract the first 40 bpm in the tag? then you don’t need a compensation value, you can simply create your formula with the 60 degree angle.

((((clamp([HR],40,200)-40)/160)*60))

Screenshot 2024-08-09 212214

1 Like

Ha Ha . Yes @JK_WatchDesign . Ask 3 Makers how to make something you will get 3 different answers . I worked in Workshops making stuff and the kids got quite confused Asking around for Ideas . When I have a formula in a Line I usually set it to Zero and do everything in the TAG BOX . If I am doing positional stuff it helps for recentring stuff . Obviously in that case I leave the pivot point as the number shown . I must say I have spent more time over at Facer and started here with some bad habits Day One . This Topic could become a Tutorial for Learners . Thanks for Joining in .

Please Excuse me . I see you have Made some wonderful Tutorials already . So thanks for that as well .

1 Like

Laugh. I agree with you. I haven’t done anything for a long time now and stumbled into the forum again today. The first post I opened was this one. The structure of your test took some getting used to, but the most important thing is that you find your way around your work. And it works both ways. I always enjoy learning new things. I don’t like simply copying because someone presents a solution. I want to understand the solution and then be able to adapt it to my needs. This forum is very helpful and I would like to thank people like you who take the time to help.

And who knows, maybe the next developer will show up for the “3rd solution/answer”. :sweat_smile:

1 Like

You bet . I know a couple for whom KISS means . Keep it Sophisticated Smarty . Good to meet you . I am one of those that Pogs about till it works then that is it . Sometimes I do not know why it works . I am into Moon Phase Stuff and Sun Rise Sun Set which we do not have Tags for yet . :blush::rofl::+1: