Rotary Encoder for Game controller

I'm making a game controller and have before successfully used the incredible Leobodnar boards, like the BU0846 and the BBI-64. On these it's abreeze to connect buttons, pots, rotary encoders, joysticks etc.

My goal now is to replace the Leobodnar BU0846 with an Arduino Pro Micro and have done this quite successfully. Buttons are connected in a matrix and multiple buttons can be pressed simultaneously without the need for extra resistors or diodes using the excellent keypad.h library. I use joystick.h library to setup the controller and everything works as it should, right now it seems to be as good as the BU0846.

Now to the problem. I'd like to add rotary encoders and possibly also rotary switches, most important is the rotary encoder though. I've searched for suitable libraries but haven't been very successful. The kind of rotary switch I have and want to use only has three pins, inputs 1 & 2 and ground. I've tried some code I've found but according to the serial output it doesn't work very well.

Preferably I'd like to find a library that makes coding a breeze but anything to help me is aprreciated of course. :slight_smile:

Example of rotary encoder: CTS 288

Example of rotary switch: SLI 12

My HOTAS Gamepad designs

Unfortunately, the web page for the "rotary switch" doesn't seem to provide any useful technical info on how to connect it. It must be some kind of encoder. The claim is that it only requires 3 connections rather than the 13 (really 12 + ground) you'd need for an unencoded switch.

The rotary encoder should work with the PJRC Encoder library that everyone else uses.

Thanks, that's a library I haven't tried and it seems quite simple. :slight_smile:

I'll try it today.

Thanks, I’ve tried it and it works! I’m not sure if I the pins are connected to pins that has interrupt capability but not really sure if it matters? The rotary encoder will not turn many turns and not really fast either.

The library works with Arduino Pro Micro?... really love to try this library. Thanks

What kind of controller do you have the rotary encoders showing up as with the joystick library? An axis? A mouse? Key presses?

Also, were you able to figure out how to use the rotary switches?