Instructions

38
GPIO.setup(taste2, GPIO.IN, GPIO.PUD_DOWN)
z=[0,0,0,0]
def za():
for i in range(4):
for s in "abcdefg":
GPIO.output(seg[s], 0)
GPIO.output(zif[i], 0)
for s in zahl[z[i]]:
GPIO.output(seg[s], 1)
time.sleep(0.001)
GPIO.output(zif[i], 1)
print("Zum Start des Countdowns und zum Neustart Taste 1 drücken")
print("Zum Beenden Taste 2 drücken")
while True:
t=datetime.date(2019, 12, 24) - datetime.date.today()
x=t.days
z[0]=int(x/1000)
z[1]=int(x%1000/100)
z[2]=int(x%100/10)
z[3]=int(x%10)
if GPIO.input(taste2)==1:
break
while GPIO.input(taste1)==0:
za()
if GPIO.input(taste2)==1:
break
while x>=0:
z[0]=int(x/1000)
z[1]=int(x%1000/100)
z[2]=int(x%100/10)
z[3]=int(x%10)
for j in range(100):
za()
x-=1
if GPIO.input(taste2)==1:
break
while GPIO.input(taste1)==0:
za()
if GPIO.input(taste2)==1:
break
GPIO.cleanup()