Line 11... |
Line 11... |
11 |
oldstav = gpio.digitalRead(88) |
11 |
oldstav = gpio.digitalRead(88) |
12 |
|
12 |
|
13 |
while True: |
13 |
while True: |
14 |
stav = gpio.digitalRead(88) |
14 |
stav = gpio.digitalRead(88) |
15 |
|
15 |
|
16 |
if stav != oldstav and stav == 0: |
16 |
if oldstav == 0 and stav == 0: |
17 |
subprocess.call("shutdown -P 1", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
17 |
subprocess.call("shutdown -P 1", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
18 |
oldstav = stav |
18 |
oldstav = stav |
19 |
|
19 |
|
20 |
time.sleep(1) |
20 |
time.sleep(2) |
21 |
|
21 |
|
22 |
|
22 |
|