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:
parent
fad63c0c18
commit
fdea19a45b
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user