Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added extra construction support to Encoder.py to support pullup dire…
…ction from Code.py (#891) * Added support to Encoder.py to allow GPIOEncoder to accept tuple for pin_button construction. This includes allowance for pull resistor (pullup/pulldown) customisation directly from code.py. Additionally the change preserves state generation semantics for pin_button.get_value(self) and depends upon the pull direction. The default pull direction remains as digitalio.Pull.UP * Replaced multiline ternary/conditional expression with a regular If statement for EncoderPin.get_value() as suggested in review * Prior commit failed test. Audio Mute was assigned to the encoder push button action and was activating upon keyboard USB insertion without user interaction. Fixed this error. * Implemented the reviewer suggestion for the GPIO constructor to take in an additional optional argument defaulting to Pull.UP instead of overloading the argument with a tuple. This is tested, and documented in English * Fix formatting encoder.py --------- Co-authored-by: Gordon Jamieson <[email protected]> Co-authored-by: xs5871 <[email protected]>
- Loading branch information