I have a problem when I reach 65535

Hello, I have been playing around with some quadrature encoders, I have it counting up and down nicely, BUT I have a problem when I reach 65535 next number is zero, surely it can count higher than that I need to be able to count up to about 144000. My project is using the quadrature encoders to precisely work out what angle the antennas are pointing up to 0.01 of a degree. Has anybody got any ideas that might help.


I think you're using an integer to store the value, where a long is required. Read this: * https://www.arduino.cc/reference/en/language/variables/data-types/int/ * https://www.arduino.cc/reference/en/language/variables/data-types/long/