brettmclean / pad4pi

Interrupt-based matrix keypad library for Raspberry Pi
GNU Lesser General Public License v3.0
51 stars 19 forks source link

Fix #16 potential short circuit if multiple pins are pressed #17

Open EternityForest opened 4 years ago

EternityForest commented 4 years ago

This patch should fix issue #16 , by never using HIGH outputs and instead switching pins to tristate for scanning.

tomekzaw commented 3 years ago

@EternityForest Thanks for your contribution! Unfortunately, it looks like this pull request introduces a noticeable lag after each press as well as occasional segmentation faults on Raspberry Pi Zero with Python 3.9.0 for 4x4 keypad. I suspect that calling GPIO.remove_event_detect and GPIO.setup for each column pin on each press can be time-expensive, especially for weaker platforms. Can this be somehow optimized?