RobTillaart / rotaryDecoder

Arduino library for a PCF8574 based rotary decoder - supports 4 rotary encoders.
MIT License
12 stars 4 forks source link

add support for rotary encoder with a switch in it #2

Closed RobTillaart closed 3 years ago

RobTillaart commented 3 years ago

Some rotary encoders have a switch (RES) in it, would be nice to have support for them to.

A derived class could be named rotaryDecoderSwitch ,

A PCF8575 / MCP23017 would be able to support 5 rotary encoders with switch.

Or one class that support both, e.g. config SNN means Switch NoSwitch NoSwitch (totals 3+2+2=7 pins) but that would make it quite complex.


RE = Rotary Encoder RES = Rotary Encoder with Switch RESL = Rotary Encoder with Switch single color LED RESML = Rotary Encoder with Switch Multicolor LED

RobTillaart commented 3 years ago

The pulse of the rotary is more "permanent" than the pulse of the press of the switch.

As the PCF cannot be read from interrupt (at least not on an UNO) one might miss the press when there is substantial time between the interrupt and handling the flag set.

RobTillaart commented 3 years ago

Should be a separate class.

After some thoughts a configurable class that support mixtures would be rather complex. Some RE do also have a LED light, (RESL) supporting that could work if it was only on/off. would require at least 4 pins which would be a nice fit (2RESL on one PCF)

Multicolor LED would need more pins LED might also need PWM, which is not optimal to implement by means of a PCF8574

RobTillaart commented 3 years ago

created https://github.com/RobTillaart/rotaryDecoderSwitch