So, here's the program:
Code: Select all
import RPi.GPIO as GPIO
import time
import os
GPIO.setmode(GPIO.BOARD)
GPIO.setup(40, GPIO.OUT)
GPIO.output(40, True)
time.sleep(1)
GPIO.setup(38, GPIO.IN)
while True:
if(GPIO.input(38)):
os.system("sudo shutdown -h now")
break
time.sleep(1)
My question:
Using the program as it is now, does it have a 1 second delay only because of the time.sleep in the while loop, or do I have 2 seconds in total because the whole program running ?
Many thanks in advance...