Fixed Schauzeichen implementation

This commit is contained in:
klonfish 2015-05-18 14:52:20 +02:00
parent 61d109d9d2
commit 9eeae13691
1 changed files with 21 additions and 21 deletions

View File

@ -4,7 +4,7 @@ import time
import threading
class TelefonapparatPinConfiguration(object):
class FeApPinConfiguration(object):
def __init__(self):
self.pin_nsa = 11
self.pin_nsi = 13
@ -14,7 +14,7 @@ class TelefonapparatPinConfiguration(object):
self.pin_wecker_a = 18
self.pin_wecker_b = 19
class TelefonapparatUserInterface(object):
class FeApUserInterface(object):
def __init__(self, pinconfig):
self.__pinconfig = pinconfig
@ -92,34 +92,34 @@ class TelefonapparatUserInterface(object):
self.__weckt = False
def set_schauzeichen(self, enabled):
gpio.output(self.__pinconfig.pin_wecker_a, 1 if enabled else 0)
gpio.output(self.__pinconfig.pin_schauzeichen, 1 if enabled else 0)
if __name__ == '__main__':
gpio.setmode(gpio.BOARD)
pinconfig = TelefonapparatPinConfiguration()
t = TelefonapparatUserInterface(pinconfig)
pinconfig = FeApPinConfiguration()
t = FeApUserInterface(pinconfig)
def dailed(num):
print num
t.add_nummernschalter_callback(dailed)
t.set_schauzeichen(true)
time.sleep(0.5)
t.set_schauzeichen(false)
time.sleep(0.5)
t.set_schauzeichen(true)
time.sleep(0.5)
t.set_schauzeichen(false)
time.sleep(0.5)
t.set_schauzeichen(true)
time.sleep(0.5)
t.set_schauzeichen(false)
time.sleep(0.5)
t.set_schauzeichen(true)
time.sleep(0.5)
t.set_schauzeichen(false)
time.sleep(0.5)
t.set_schauzeichen(True)
time.sleep(0.5)
t.set_schauzeichen(False)
time.sleep(0.5)
t.set_schauzeichen(True)
time.sleep(0.5)
t.set_schauzeichen(False)
time.sleep(0.5)
t.set_schauzeichen(True)
time.sleep(0.5)
t.set_schauzeichen(False)
time.sleep(0.5)
t.set_schauzeichen(True)
time.sleep(0.5)
t.set_schauzeichen(False)
time.sleep(0.5)
t.set_wecker(True)
time.sleep(20)