Feel like this is probably a very simple answer but i am just stuck. I have two sensor (ultrasonic) with a variable outputs. I want to a motor to active when both sensors are equal or with in plus or minus two. I have written it out but there must be a more concise way of doing this with equal, greater or lesser than fuction but i cant figure out how.
One question is not answered yet. Are the variables of integer or float type?
If they are float the original expression gives false
if e.g. R_DisCM = 3.5 and L_DisCM = 2.75 as the difference is not an integer.
Strictly speaking, two numbers cannot be "within" a negative distance: just imagine them on the number line. Calculating by subtraction can result in a negative number of course, if it's in the "wrong order". So