0

CircuitPython Pico RC0 and Rotary Encoder
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CircuitPython Pico RC0 and Rotary Encoder

by nevyn on Mon Apr 05, 2021 1:15 pm

I'm trying to get a rotary encoder working with the Pico and the CircuitPython 6.2.0 RC0. I'm following this page: https://learn.adafruit.com/rotary-encoder/circuitpython, basically the code is:
Code: Select all | TOGGLE FULL SIZE
import rotaryio
import board
encoder = rotaryio.IncrementalEncoder(board.GP14, board.GP15)
last_position = None
while True:
    position = encoder.position
    if last_position is None or position != last_position:
        print(position)
    last_position = position

Saving to the board generates the following error:
Code: Select all | TOGGLE FULL SIZE
Traceback (most recent call last):
  File "code.py", line 6, in <module>
ValueError: pull masks conflict with direction masks

Has anyone seen this problem before or have any advice?

Thanks in advance,
Mark

nevyn
 
Posts: 5
Joined: Sat Mar 27, 2021 1:28 pm

Re: CircuitPython Pico RC0 and Rotary Encoder

by mikeysklar on Tue Apr 06, 2021 6:41 pm

Hi Mark,

I think we have another thread on this going.

viewtopic.php?f=60&t=176616&p=860422&hilit=pull+masks+conflict#p860422

Which two pins are you using? You might want to join in on the above link since it is the same issue.

mikeysklar
 
Posts: 3923
Joined: Mon Aug 01, 2016 8:10 pm

Re: CircuitPython Pico RC0 and Rotary Encoder

by nevyn on Wed Apr 07, 2021 1:50 am

I'll reply on the thread mentioned.

Thank you,
Mark

nevyn
 
Posts: 5
Joined: Sat Mar 27, 2021 1:28 pm

Please be positive and constructive with your questions and comments.