Reading encoder to count steps(solved)

You do this unconditionally every time around loop:

  encoderPosOld = encoderPos;

So it seems unlikely that the difference will ever be anywhere near 1070. Might work better to do it only when you change StepCounter.