Inverting motor's rotation I've designed a robot with two motors. It works as follows:

The first motor is attached to the the person's arm, the second motor receives the calculated movement and moves accordingly.

When the person moves his hand (open/close) the other robot moves the the opposite direction; upon opening it closes and vise-versa.

I've tried to invert the movement by multiplying by -1 but the second motor keeps moving on his own. I've tried multiplying the results of both motors, before subtracting, with no success.

The 'code' does the following:


I take the movements of motors A and B 
Subtract value of motor A from motor B's
Save the result to a variable-'moveDist'
Take the absolute value after subtraction for comparison
If greater than 6, pass 'moveDist' value to the second motor.
I think the main problem is, that you use the "Motor on for # degrees". The program will wait until this command is executed (i.e. the required turn is made), and this can take quite long. The next measurement of the angle difference is taken after that. Having a high start deviation and/or fast turning rates of your reference motor, you will not get a stable result.
Instead I propose to use the angle difference for the "Power" input of the "Motor on" command. In that scenario the angle difference is measured very often, and the "slave" motor is following your "master" motor very pecisely.