Page 1 of 1

Rotary encoder overlay - cant use the switch

Posted: Sun May 09, 2021 5:40 am
by earthdog
I have a rotary encoder setup as device in config.txt:

Code: Select all

dtoverlay=rotary-encoder,pin_a=18,pin_b=17,relative_axis=1,steps-per-period=1
The knob works ok with evtest and python programs, but i cant get the switch to work. Is it supposed to work or not?

Re: Rotary encoder overlay - cant use the switch

Posted: Sun May 09, 2021 12:24 pm
by thagrol
Judging by the docs, the encoder overlay doesn't support a button/switch pin.

You could always add the gpio-key overlay for the switch (see /boot/overlays/README)

Re: Rotary encoder overlay - cant use the switch

Posted: Mon May 10, 2021 7:54 am
by PhilE
I'm assuming the button has a GPIO of its own? Yes - gpio-key is probably the way to go.