From 9eeae13691dea3208bfeeb8aef56fdbe96707e02 Mon Sep 17 00:00:00 2001 From: klonfish Date: Mon, 18 May 2015 14:52:20 +0200 Subject: [PATCH] Fixed Schauzeichen implementation --- tuitest.py | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/tuitest.py b/tuitest.py index adc7197..9f0875e 100644 --- a/tuitest.py +++ b/tuitest.py @@ -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)