-
Notifications
You must be signed in to change notification settings - Fork 89
RotaryEncoder
RotaryEncoderis a library for PyBBIO to interface with Rotary Encoders.
The example program using this library is here.
Creates an instance of the class RotaryEncoder. eqep_num determines which eQEP pins are set up. eqep_num can be: EQEP0, EQEP1, EQEP2 or EQEP2b based on which pins the rotary encoder is connected to.
Turns the eQEP hardware ON
Turns the eQEP hardware OFF
Set mode as Absolute. The position starts at zero and is incremented or decremented by the encoder's movement.
Set mode as Relative. The position is reset when the unit timer overflows.
Returns the mode the eQEP hardware is in.
Get the current position of the encoder. In absolute mode, this attribute represents the current position of the encoder. In relative mode, this attribute represents the position of the encoder at the last unit timer overflow.
setFrequency(freq) Set the frequency in Hz at which the driver reports new positions.
Give a new value to the current position
Set the current position to 0