print("Button is released!")
GPIO.output(relayPin,relayState)
lastButtonState = reading
def destroy():
GPIO. output(relayPin, GPIO. LOW) # relay off
GPIO. cleanup() # Release resource
if __name__ == '__main__': # Program start from here
setup()
try:
loop()
e xcept KeyboardInterrupt:
destroy()