I do not really know what I was hoping for haha! I was just asking the question to try and understand the situation I was in.
I am not adding the error each time, I am just taking the count on the encoder wheel that is closest to the degree I want to measure, and calculating the error of the potential scaled value (I think!).
For example, measuring 359 degrees:
deg (359) = 1021 * 360 / 1024 = 358.9453125
1021th count = 358.9453125 (0.0546875 error)
My current understanding, thanks to your help, is that my eventual code will either need to display the decimals after the integer so a user can determine when the shaft is closest to 1 degree, or my code will need to determine when a degree is registered (threshold).
E.g. for a transition between 4 and 5 degrees:
8th = 2.8125
9th = 3.1640625 (3 degrees)
10th = 3.515625 (3.5 degrees)
11th = 3.8671875 (4 degrees)
12th = 4.21875
13th = 4.5703125 (4.5 degrees)
14th = 4.921875 (5 degrees)
15th = 5.2734375
From this thread, I do not really understand my requirement. Instead of saying I want to measure the shaft angle each degree, I should state how accurate I want the measurements to be. This is a good learning experience.
I guess I also want to understand how to make the scaling in the code decide when a degree should be displayed.
Ah, I think you've hit the point. Because I am turning the shaft by hand, I wanted to measure the shaft angle and display it, so my thoughts were on the sensor detecting each degree.
But really, I manually want to position the shaft every degree. Although I am not using a motor, I am still positioning it and not measuring it. Sorry aarg and cedarlakeinstruments.