Rename global encoder variable
This commit is contained in:
parent
a28e0fb6aa
commit
8a7f409c4c
1 changed files with 2 additions and 2 deletions
|
|
@ -27,7 +27,7 @@ from debouncer import Debouncer
|
|||
# Initialize Rotary encoder
|
||||
|
||||
button = Debouncer(board.D12, digitalio.Pull.UP, 0.01)
|
||||
encoder = rotaryio.IncrementalEncoder(board.D10, board.D11)
|
||||
rotary_encoder = rotaryio.IncrementalEncoder(board.D10, board.D11)
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
# Initialize I2C and OLED
|
||||
|
|
@ -99,7 +99,7 @@ while True:
|
|||
angle = 0
|
||||
|
||||
else:
|
||||
current_position, change = get_encoder_change(encoder, current_position)
|
||||
current_position, change = get_encoder_change(rotary_encoder, current_position)
|
||||
if change != 0:
|
||||
if mode == 0:
|
||||
angle = min(180, max(0, angle + change * 5))
|
||||
|
|
|
|||
Loading…
Reference in a new issue