0

Rotary Encoder On Rpi Pico
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Rotary Encoder On Rpi Pico

by Jnorris03 on Wed Mar 10, 2021 10:28 pm

It looks like the rotaryio module isn't included in the Pico port? Is there any easy way to import it? What is the best way to implement an encoder without it? I've tried bringing the pulses in as normal inputs, but I don't think I can process them fast enough because the state changes seem to be erratic.

Jnorris03
 
Posts: 12
Joined: Sun Mar 07, 2021 11:55 am

Re: Rotary Encoder On Rpi Pico

by awesometech on Thu Mar 11, 2021 7:16 am

I believe it has been added to the newest build, but beware not everything maybe stable.
https://adafruit-circuit-python.s3.amaz ... y_pi_pico/

awesometech
 
Posts: 3
Joined: Thu Apr 11, 2019 1:08 pm

Re: Rotary Encoder On Rpi Pico

by Jnorris03 on Thu Mar 11, 2021 1:50 pm

Hmm... Ok I'll check that when I get home. I thought I had the latest version, but maybe not.

Jnorris03
 
Posts: 12
Joined: Sun Mar 07, 2021 11:55 am

Re: Rotary Encoder On Rpi Pico

by Jnorris03 on Thu Mar 11, 2021 8:23 pm

So now I get the error "pull masks conflict with direction masks" but I can't find any documentation on that error. I assume it because I was using the pins for something else already and they need to be released?

Edit: I got it working with two other pins; so it must be something with certain pins on the Pico port.

Jnorris03
 
Posts: 12
Joined: Sun Mar 07, 2021 11:55 am

Re: Rotary Encoder On Rpi Pico

by tannewt on Fri Mar 12, 2021 4:16 pm

Which two pins failed originally? We may have a math error internally.

tannewt
 
Posts: 2349
Joined: Thu Oct 06, 2016 8:48 pm

Re: Rotary Encoder On Rpi Pico

by Jnorris03 on Fri Mar 12, 2021 7:48 pm

I was originally trying to us GP14 and GP15. I got it working on GP16 and GP17.

Jnorris03
 
Posts: 12
Joined: Sun Mar 07, 2021 11:55 am

Re: Rotary Encoder On Rpi Pico

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

I had the same issue with the RC0 build. I was also using GP14 & GP15.

I'll try moving the pins later.

Regards,
Mark

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

Re: Rotary Encoder On Rpi Pico

by nevyn on Wed Apr 07, 2021 4:05 am

I have just tried this with the 6.2 release version of CircuitPython and the code fails with an error on GP14 & GP15. It does run on GP16 and GP17 but does not work.

Time to have a look at what the hardware is doing.

Regards,
Mark

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

Re: Rotary Encoder On Rpi Pico

by adafruit2 on Wed Apr 07, 2021 12:55 pm

GP15 is not recommended for use - it can interfere with USB, just use any other pins :)

adafruit2
Site Admin
 
Posts: 19887
Joined: Fri Mar 11, 2005 7:36 pm

Re: Rotary Encoder On Rpi Pico

by nevyn on Fri Apr 09, 2021 1:10 pm

adafruit2 wrote:GP15 is not recommended for use - it can interfere with USB, just use any other pins :)


How about changing the exception to something meaningful. The message pull masks conflict with direction masks is really not very helpful.

Regards,
Mark

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

Please be positive and constructive with your questions and comments.