Description
CircuitPython version
Adafruit CircuitPython 7.2.0-alpha.1-74-g9c6e34df0 on 2022-01-11; Raspberry Pi Pico with rp2040
Code/REPL
# uses circuitpython
from time import sleep
import board
import rotaryio
enc = rotaryio.IncrementalEncoder(board.GP10, board.GP11, divisor=1)
last_position = enc.position
while True:
if(enc.position != last_position):
print(enc.position)
last_position = enc.position
sleep(0.01)
Behavior
Nothing happens, no count, unusual pin behaviour at pin_a and pin_b
Description
I used a normal alps encoder connected with a and b switch to 3V3 and got no counts so I tested the pin lever using a scope and a voltage or ampere meter:
no program: pins are low
Behaviour with no pulldown attached:
If start the program the pins go to high (all other unused pins stay low)
Behaviour with 24kOhm pulldown
If start the program the pins at aprox. 1,25 V (so somewhere in between)
I checked the rotaryio behavior against the countio behavior: With countio the pins stay low.
Maybe the rotaryio module switches the pullup on? I tested the rotary pins with an ampere meter and i got 56 uA PIN to GND
If I wire the encore to GND everything works fine.
I read the documentation, but I did not find, that the pullups are enabled at the pi pico when rotaryio is used
So one way would be to document this behaviour
Another way would be to turn off the internal pullups and leave it to the user
a third way would be to add a pull-option
Additional information
No response