Browse Source

Fixed Schauzeichen implementation

pull/1/head
klonfish 10 years ago
parent
commit
9eeae13691
  1. 42
      tuitest.py

42
tuitest.py

@ -4,7 +4,7 @@ import time @@ -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): @@ -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): @@ -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)

Loading…
Cancel
Save