I was using an encoder to test a motor, and the encoder was giving me huge values after I had done some math with them. I changed my code to spit out the raw data, and found that the encoder was giving me values with an absolute value between 1.06 - 1.08 billion, even with a rotation of just a few ticks. I’m using EasyC, and I have the encoder plugged into digital ports 1 and 2. I’ve attached pictures of my setup.
I program my encoders with raw data and I think you need to put the variable encOld or encNew into the Print to Screen instead of velocity and power and it should work just fine if you want to see the enconder ticks
Power, encOld, and encNew are ints, velocity is a double. I adapted this from my previous code, velocity used to be (encNew-encOld). In this, it is not actually velocity. Sorry about the lack of clarity.