1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

leave Pi GPIO pins in a sensible state on error

This commit is contained in:
Dave Conway-Jones 2016-10-11 15:37:34 +01:00
parent fad63c0c18
commit fdea19a45b

View File

@ -89,7 +89,10 @@ if len(sys.argv) > 2:
GPIO.cleanup(pin) GPIO.cleanup(pin)
sys.exit(0) sys.exit(0)
except: except:
data = 0 if len(sys.argv) == 4:
data = int(sys.argv[3])
else:
data = 0
if data != 0: if data != 0:
data = 1 data = 1
GPIO.output(pin,data) GPIO.output(pin,data)