mirror of
https://github.com/sigmasternchen/PiSwitch
synced 2025-03-15 07:58:58 +00:00
some optimizations
This commit is contained in:
parent
509c43bb38
commit
95a1873ad8
1 changed files with 9 additions and 9 deletions
|
@ -9,24 +9,24 @@ GPIO.setup(14,GPIO.IN,pull_up_down=GPIO.PUD_UP)
|
|||
GPIO.setup(15,GPIO.IN,pull_up_down=GPIO.PUD_UP)
|
||||
GPIO.setup(18,GPIO.IN,pull_up_down=GPIO.PUD_UP)
|
||||
|
||||
#how are you turning them off again?
|
||||
|
||||
while True:
|
||||
input_state1 = GPIO.input(14)
|
||||
input_state2 = GPIO.input(15)
|
||||
input_state3 = GPIO.input(18)
|
||||
if input_state1 == False:
|
||||
print('Button 1, Steckdose 1 an')
|
||||
time.sleep(1.5)
|
||||
os.system("sh 11.sh")
|
||||
os.system("./regenerate.sh 11")
|
||||
if input_state2 == False:
|
||||
print('Button 2, Steckdose 2 an')
|
||||
os.system("sh 21.sh")
|
||||
time.sleep(1.5)
|
||||
os.system("./regenerate.sh 21")
|
||||
if input_state3 == False:
|
||||
print('Button 3, Steckdose 3 an')
|
||||
os.system("sh 31.sh")
|
||||
os.system("./regenerate.sh 31")
|
||||
# if you don't sleep in a while true loop you are going to burn your only cpu core
|
||||
time.sleep(1.5)
|
||||
|
||||
|
||||
#s01 = open("status_01.txt", "r")
|
||||
#s01.close
|
||||
|
||||
|
|
Loading…
Reference in a new issue