tttapa/Control-Surface

Request example code for rotary encoder with 10-bit precision (1024 steps) & 14-bit presicion (16383 steps)

DRCRecoveryData opened this issue · 3 comments

Hi,

Could you provide example code for rotary encoder with 10-bit precision (1024 steps) and 14-bit presicion (16383 steps), i have plan to use with CD4051 for 27 rotary encoder 300 degree. also could you give example for CD4051 with roraty encoder too?

Best regards,

tttapa commented

Are you talking about rotary encoders or potentiometers. Rotary encoders don't have an absolute number of steps, they are endless, and their resolution is usually denoted in steps per revolution.

See the FAQ for an explanation of why you cannot use a CD4051 for rotary encoders: https://tttapa.github.io/Control-Surface-doc/Doxygen/da/dc1/FAQ.html#faq-mux-encoder

tttapa commented

See the CC14Potentiometer class from #202 (comment). You can use it in the same way as CCPotentiometer, see the Getting Started guide to learn how to use multiple potentiometers on a multiplexer.

I wouldn't recommend increasing the resolution to 14 bits (MIDIFilteredAnalog<ContinuousCCSender14<14>>), because it is unlikely that your board has a 14-bit ADC (AVR boards have a 10-bit ADC, some newer ARM ones 12 or 13). Control Surface can give you a bit more precision because of its oversampling and filtering code, but that has its limits.