Control-Surface icon indicating copy to clipboard operation
Control-Surface copied to clipboard

Using push button on rotary encoder causes encoder to decrement value

Open rubixqmusic opened this issue 3 years ago • 1 comments

Using the push button on a rotary encoder causes the encoder value to decrement on each push.

I'm using some combination rotary encoders/push buttons. I wired up the encoder as described in the Rotary Encoder example. Since the rotary encoders in the Control Surface Library don't include buttons, connected the button lead to an open pin and set it up as a CCButton.

The rotary encoder works as expected, and sends the correct values. The button portion does not register at all, and pushing it messes with the rotary encoder value.

I'm a total noob with rotary encoders. My best guess is that is has to do with the buttons on rotary encoders being active low while the CCButtons are configured with internal pullup resistors, and somehow pushing the button pulses either the A or B input. Not sure. Any advice or workarounds would be greatly appreciated!

rubixqmusic avatar Dec 31 '20 19:12 rubixqmusic

This sounds like a hardware issue. Please double check the wiring diagram or data sheet and compare it with the wiring you have.

The common pin should go to ground, A and B to input pins of the Arduino (without resistors, the internal pullups are used). One pin of the switch should go to ground as well, and the other to a third input pin (again without any resistors).
The A/B pins should be separate from the switch pin (except for the ground connection, of course).

If that still doesn't work, please post a schematic and picture of your setup.

tttapa avatar Jan 01 '21 12:01 tttapa