How to ignore certain values?

I got following problem:
receiving values from a controller (slider 0-255) and want to use just range 100-200 for controlling a servo
I mappe/clipped the incoming to be clipped outside of 100-200 and mapped that to out 0-1
working fine sofar, but:
sometimes its missing values coming in and therefore servo jumps to the lowest value (e.g. 0)
also when I receive values below 100 it jumps to the lowest point

how can I do it that this servo completely ignores values outside of its range (100-200) and does therefore nothing ?

Tried it with a PID node - but thats too much for me - have no clue about that :wink:
Was also thinking about something if-else ?

Anyone an idea ?
Thanks
Marty

Test with map-clip node

I did
“I mappe/clipped the incoming to be clipped…”
It also jumps to the lowest clipped range when it receives values outside of his range
thats exaclty my problem
values outside of predetermined range are not ignored unfortunately

The entry is 0-1023, you must combine them, try this way

map-clip

I put the constants as a reference, you can load the values in the node as always

OK tried with different varaitions but I am a little bit confused with your values :wink:

My intended rout would be:
income 0-255
just take the range of 100-200 (ignore the rest)
map this range to 0-1 (for a servo)

isnt than the S&T vice versa in your expample of the clip node or maybe I dont get this at all

sorry, arranged :grimacing:

Hi Marty!

You can use gate node that lets values through based on a certain condition.
Also, check out pulse-on-change node and connect it to servo's UPD.

If you are trying to completely ignore slider values outside a specific range (i.e. a flaky pot sometimes jumps to min or max value), then clip/map isn’t going to help because it will still jump to min/max allowed value. In this case, you want to completely ignore the slider min/max values and keep old values while receiving invalid inputs. The gate node mentioned by evgenykochetkov allows you to do this. Only enable the gate when values are within specified range, then feed the map node from the gate. With this config, it shouldn’t be necessary to use server’s UPD pin. Alternately, you could only pulse the servo UPD pin when slider values are in range & feed all values to map (since out-of-range values will be ignored by servo).

2 Likes

oh, I did not know gate kept the value that’s why I made some latch :man_facepalming:

Now with respect to the value, if you take it from an analog port, you must map it, is that so?
then with beetwen and gate eliminates the jumps, correct?

thanks to all of you - thats exactly what I figured out right now as well
clip/map is not the solution
I did the same - a simple between that triggers the gate and feeds than a mapping

on top I used your servo enable node and fed his enable pin also from the between

an I can confirm between node eliminates 100% everything outside the range

1 Like

@ cesars: yes, map/clip will jump to its min/max when receiving lower or higher values than in its range

ok, I misunderstood, I thought it was a slider pot analog

sorry if I was too unprecise - no its a value coming over bluetooth
sorry its all my newbie approach to all that stuff :wink:
but thanks for all your help

1 Like

Now the slider only works in a midrange, if you map it you can use the whole slider 100%

servo