I have four motors that I'm trying to get to move precisely together (within + or - 2 encoder ticks) I'm using a 2560 mega and 4 of its interrupt pins to trigger the interrupt example sketch found here: http://playground.arduino.cc/Main/RotaryEncoders
for each motor.
I've copied the code four times and changed the variables accordingly. The 1st motor encoder works as expected. The other 3 cycle between 0 and 1. If I hash out all but one motor and encoder set it works. Each motor and encoder work individually. It only fails when trying to run all four together. Can interrupts get in the way of each other?
Is there a better way to determine that four motors are moving together at the same rpm while keeping track of distance traveled?