Browse Source

FeApInterface now sets the pin numbering as given in the pin config

master
klonfish 10 years ago
parent
commit
39f0a68812
  1. 4
      tuitest.py

4
tuitest.py

@ -6,6 +6,7 @@ import threading
class FeApPinConfiguration(object): class FeApPinConfiguration(object):
def __init__(self): def __init__(self):
self.numbering = gpio.BOARD
self.pin_nsa = 11 self.pin_nsa = 11
self.pin_nsi = 13 self.pin_nsi = 13
self.pin_gabelschalter = 15 self.pin_gabelschalter = 15
@ -18,6 +19,7 @@ class FeApUserInterface(object):
def __init__(self, pinconfig): def __init__(self, pinconfig):
self.__pinconfig = 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_nsa, gpio.IN, gpio.PUD_UP)
gpio.setup(self.__pinconfig.pin_nsi, 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) gpio.setup(self.__pinconfig.pin_gabelschalter, gpio.IN, gpio.PUD_UP)
@ -46,7 +48,7 @@ class FeApUserInterface(object):
self.__nsi_cnt = 0 self.__nsi_cnt = 0
else: else:
for cb in self.__nummernschalter_callbacks: for cb in self.__nummernschalter_callbacks:
cb(self.__nsi_cnt) cb(self.__nsi_cnt % 10)
def __on_nsi_falling(self, pin): def __on_nsi_falling(self, pin):
#print 'nsi' #print 'nsi'

Loading…
Cancel
Save