As we know a normal Ultrasonic sensor works when we put an object near the sensor, the distance value is small and if we put the object far the distance value will be large. So for my application, I want the functionality to be inverted. Is there any way of mathematical calculation that may convert the distance value into another value like the one below?
My application: When the object is near, the value will be large, and when the object is far, the value will be small.
Hello rockrziq, Good day and wolcome to the Forum.
You have to define what is far.
Say far = 200cm and the object is 10 cm in front of the sensor.
distance = 200cm - 10cm = 190cm
Other way round object is 180cm away from sensor
distance = 200cm - 180cm = 20 cm
So as already written the "Substraction" is the solution.