Kitwn
Member
Last year I built a MIDI controller for a software guitar amplifier using rotary encoders, a Teensy 4.1 and the Encoder library. It worked very well but the need for 2 pins per encoder rather than 1 for a potentiometer restricts the number of encoders which are the preferred device where one knob may be used to adjust several inputs.
I wondered if it would be possible to devise a library that uses one pin per encoder plus 2 ( or possibly just 1 with an external inverter) additional pins. The idea is that instead of commoning the centre (c) pins of the encoders and reading the other two (a,b), the a and b pins are each commoned to an output pin with the c pins having an input pin each. By setting the a pins high and b pins low, reading the c pins will indicate which are connected to a. Reversing the polarity of the a and b pins will allow you to read the b pins. Putting this data into arrays and compare readings on each program cycle will derive the same information as the normal process.
This method may not be fast enough for motor driven encoders but might work for manually operated knobs on a control surface.
My skills are limited to some basic Arduino-Speak coding so I'm throwing this idea out to those who will know whether or not it is practical and how to make it work if it is.
I wondered if it would be possible to devise a library that uses one pin per encoder plus 2 ( or possibly just 1 with an external inverter) additional pins. The idea is that instead of commoning the centre (c) pins of the encoders and reading the other two (a,b), the a and b pins are each commoned to an output pin with the c pins having an input pin each. By setting the a pins high and b pins low, reading the c pins will indicate which are connected to a. Reversing the polarity of the a and b pins will allow you to read the b pins. Putting this data into arrays and compare readings on each program cycle will derive the same information as the normal process.
This method may not be fast enough for motor driven encoders but might work for manually operated knobs on a control surface.
My skills are limited to some basic Arduino-Speak coding so I'm throwing this idea out to those who will know whether or not it is practical and how to make it work if it is.
