I've been using Pad4pi on a 4x5 keypad with no problems for a while. recently I purchased a new 3x4 keypad. I modified my code but some some reason I am missing some of the buttons. I have checked the keypad using a power source and LED so can confirm the all the buttons work and are wired correctly. My code is below:
I've been using Pad4pi on a 4x5 keypad with no problems for a while. recently I purchased a new 3x4 keypad. I modified my code but some some reason I am missing some of the buttons. I have checked the keypad using a power source and LED so can confirm the all the buttons work and are wired correctly. My code is below:
from pad4pi import rpi_gpio
import time
KEYPAD = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], ["*", 0, "#"] ]
COL_PINS = [16, 5, 13] # BCM numbering 5 1 3 ROW_PINS = [19, 20, 21, 6] # BCM numbering 4 6 7 2
factory = rpi_gpio.KeypadFactory()
keypad = factory.create_keypad(keypad=KEYPAD, row_pins=ROW_PINS, col_pins=COL_PINS)
def printKey(key): print(key)
keypad.registerKeyPressHandler(printKey)
try: while(True): time.sleep(0.2) except: keypad.cleanup()
I am not getting a response from the keys; 1,5,6,7,*,0,#.
Have you any suggestions please?