You have interrupt service routines and other functions accessing the same variables, and those variables are not declared volatile.
What motor shield are you using? Does it use pins 2 and 3? Are the encoders connected to those pins?
You have interrupt service routines and other functions accessing the same variables, and those variables are not declared volatile.
What motor shield are you using? Does it use pins 2 and 3? Are the encoders connected to those pins?