Skip to content

RP2040 rotaryio fails with two encoders #10024

Closed
@todbot

Description

@todbot

CircuitPython version and board name

Adafruit CircuitPython 9.2.4 on 2025-01-29; Raspberry Pi Pico with rp2040

and:
Adafruit CircuitPython 9.2.4-5-g3236a0f200 on 2025-01-31; Raspberry Pi Pico with rp2040  
  ("absolute newest" as of noon PST 3 Feb 2025)
Adafruit CircuitPython 9.2.3 on 2025-01-17; Raspberry Pi Pico with rp2040
Adafruit CircuitPython 9.2.2 on 2025-01-09; Raspberry Pi Pico with rp2040

Code/REPL

import time, board, rotaryio

encoder1 = rotaryio.IncrementalEncoder(board.GP19, board.GP18)
encoder2 = rotaryio.IncrementalEncoder(board.GP4, board.GP5)

while True:
    print(encoder1.position, encoder2.position)
    time.sleep(0.1)

Behavior

Code hangs on creation of encoder2, which is obviously not correct.

Code should repeatedly print position of both encoders.

Description

Works on 9.2.1.
Does not work on 9.2.2 and above.
Related to #9682?

Additional information

Redditor had his issue too: https://old.reddit.com/r/circuitpython/comments/1igqzyf/two_incrementalencoders_fail/

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions