analogRead gives valies from 0 (0 volts) to 1023 (5 volts). Let’s say one side reads 700 or so, the other reads 100. Clearly those are different and you would home to one side. But if the other side reads 650? Or 750? Those are probably close enough to mean “do nothing”. But is 600 or 800 close enough? Maybe… you decide.
But what you’re trying to do (assuming you fix the first == problem) is (I think) saying they’re the same if the difference is 1000, which is the whole scale of an analogRead.
What I would do is have a variable let’s call it “threshold” and initialise it to 50 or 100. Then have a line to see if your absolute difference is < threshold. (Reason I suggest using a variable is it’s easier to change: if you decide it should be 50 not 100 it’s easy to find at the top of the sketch, don’t have to hunt.)
So just add this:
int threshold = 100;
And then change this:
if(round(mid) == 1000)
//.. to this:
if(mid < threshold)
Above all off the top of my head as I get ready to leave for work… ymmv