brettmclean / pad4pi

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

Cannot import name 'rpi_gpio' #10

Open Tim-Lorne opened 5 years ago

Tim-Lorne commented 5 years ago

`from pad4pi import rpi_gpio

import pad4pi

import RPi.GPIO as rpi_gpio

KEYPAD = [ [1,2,3], [4,5,6], [7,8,9], ["*",0,"#"] ]

ROW_PINS = [4,14,15,17] # BCM numbering COL_PINS = [18,27,22] # BCM numbering

factory = rpi_gpio.KeypadFactory()

Try factory.create_4_by_3_keypad

and factory.create_4_by_4_keypad for reasonable defaults

keypad = factory.create_keypad(keypad=KEYPAD, row_pins=ROW_PINS, col_pins=COL_PINS)

def printKey(key): print(key)

printKey will be called each time a keypad button is pressed

keypad.registerKeyPressHandler(printKey)`

o/pad4pi.py", line 1, in <module> from pad4pi import rpi_gpio ImportError: cannot import name 'rpi_gpio'

Keyboard factory also doesnt work