Trying to develop a code for aspiration and dispense using arduino mega

Im trying to developing a code for aspiration and dispense operation in opentrons p300 module using arduino mega .

i have attached filename is sketch_dec16a.ino .

In that i have used 4 motors for x,y,z,e axis.
in that im calculating the position through steps to reach the desired position.

To pick a single strip im using x,y,z axis to specific position by send serial command by (p 11) char and value, inside the function of line_4(long newx, long newy, long newz); will move as per the specific location by predefined value, but once calling the same function the motor will not move .

similarily, To pick a multi strips , 8 strips of 1 st rows by using x,y,z axis to specific position by send serial command by (P 81) char and value ,inside the function of line_4(long newx, long newy, long newz); will move as per the specific location by predefined value.

quit similarily for all position like,

P 81 to P 812 (8 strips of 1 st row to 12 th row)

p 11 to p 18 (single strip of 1 st rows-> 1st column to 8th column )

likewise i did a command for aspiration as A 1000.but i will work as predefined value by giving in the function by ->line_3(long newe); as per it will works.

similarily for the dispense command as D 81 .but i will work as predefined value by giving in the function by ->line_3(long newe);

A 1000

A stands for aspiration char

1000 stands for is calling the case 1000 : inside the function predefined xyz positions and w position
will move as per given positions.

but i need to program as aspiration and dispense method by sending the command im send in serial port in arduino mega as

A 81 1000

A stands for aspiration char

81 stands for is calling the case81 : inside the function predefined xyz position

1000 stands for that is need aspirate a 1000 step w_backward

sketch_dec16a.ino (77.5 KB)