FeApInterface now sets the pin numbering as given in the pin config
This commit is contained in:
parent
f4c4a1d0e8
commit
39f0a68812
1 changed files with 3 additions and 1 deletions
|
@ -6,6 +6,7 @@ import threading
|
|||
|
||||
class FeApPinConfiguration(object):
|
||||
def __init__(self):
|
||||
self.numbering = gpio.BOARD
|
||||
self.pin_nsa = 11
|
||||
self.pin_nsi = 13
|
||||
self.pin_gabelschalter = 15
|
||||
|
@ -18,6 +19,7 @@ class FeApUserInterface(object):
|
|||
def __init__(self, pinconfig):
|
||||
self.__pinconfig = pinconfig
|
||||
|
||||
gpio.setmode(self.__pinconfig.numbering)
|
||||
gpio.setup(self.__pinconfig.pin_nsa, gpio.IN, gpio.PUD_UP)
|
||||
gpio.setup(self.__pinconfig.pin_nsi, gpio.IN, gpio.PUD_UP)
|
||||
gpio.setup(self.__pinconfig.pin_gabelschalter, gpio.IN, gpio.PUD_UP)
|
||||
|
@ -46,7 +48,7 @@ class FeApUserInterface(object):
|
|||
self.__nsi_cnt = 0
|
||||
else:
|
||||
for cb in self.__nummernschalter_callbacks:
|
||||
cb(self.__nsi_cnt)
|
||||
cb(self.__nsi_cnt % 10)
|
||||
|
||||
def __on_nsi_falling(self, pin):
|
||||
#print 'nsi'
|
||||
|
|
Loading…
Reference in a new issue