I think there is a typo in line 82. It should be B << 1, not B << 2.
|
# We convert these to an ordinal sequence number by returning |
|
# seq = (A ^ B) | B << 2 |
|
# |
|
def rotation_sequence(self): |
|
a_state = self.gpio.input(self.a_pin) |
|
b_state = self.gpio.input(self.b_pin) |
|
r_seq = (a_state ^ b_state) | b_state << 1 |
|
return r_seq |
I think there is a typo in line 82. It should be
B << 1, notB << 2.py-gaugette/gaugette/rotary_encoder.py
Lines 81 to 88 in 14732a7