I have got the rotary encoder 4mm shaft (3530) and got the sample code example for quadrature encoder.
Code: Select all
from Phidget22.Phidget import *
from Phidget22.Devices.Encoder import *
def onPositionChange(self, positionChange, timeChange, indexTriggered):
print("PositionChange: " + str(positionChange))
print("TimeChange: " + str(timeChange))
print("IndexTriggered: " + str(indexTriggered))
encoder0 = Encoder()
input("Press Enter to Stop\n")
except (Exception, KeyboardInterrupt):
Now, I am trying to understand the number of position change for 1 lap of the encoder.
By making some tests, it looks like for positionChange, I got around 1800 for 1 lap of the encoder, but how can I know the exact number ?