AccelStepper distanceToGo value not what it should be

Hello!

description of the project: 2 arduinos are communicating over SPI. one has a touch screen, and the other is driving 2 steppers with AccelStepper. The goal of this project is to be able to move the 2 steppers with direction inputs from the screen, and have the ability to save and call multiple position combinations of the 2 steppers.

I am able to successfully save the position of the motors in a 20X2 array, but then when I grab those values and set the new target position of the stepper motors with the "move" command, and then directly after that print out the "distanceToGo" foe the steppers, the values are much much larger that expected.

and when I run the provided code, the motors respond fine to the commands from the master, but they do not run when there new positions are set,

see "first array" picture for the saved positions in the array.
see "problem" picture for the resulting values of the distance to go.

I have attached both the master and the slave devices.

master_1.0.ino (12.9 KB)

slave_1.0.ino (4.38 KB)

Have you written a short program to verify the distanceToGo() function ?

...R

You may need to use moveTo(), not move() to move to a position. move() is relative, moveTo() is absolute.