Rev 4687 | Rev 4688 | ||
---|---|---|---|
Line 13... | Line 13... | ||
13 | while True: |
13 | while True: |
14 | stav = gpio.digitalRead(88) |
14 | stav = gpio.digitalRead(88) |
15 | |
15 | |
16 | if oldstav == 0 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 | else: |
|
- | 19 | print "power is OK." |
|
- | 20 | |
|
18 | oldstav = stav |
21 | oldstav = stav |
19 | |
22 | |
20 | time.sleep(2) |
23 | time.sleep(2) |
21 | |
24 | |
22 | |
25 | |