Skip to content

Commit 0b506b2

Browse files
authored
Enabling internal pull-up resistor
Without pull-up pin is floating and can cause random shutdowns.
1 parent 8dce212 commit 0b506b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

listen-for-shutdown.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
GPIO.setmode(GPIO.BCM)
9-
GPIO.setup(3, GPIO.IN)
9+
GPIO.setup(3, GPIO.IN, pull_up_down=GPIO.PUD_UP)
1010
GPIO.wait_for_edge(3, GPIO.FALLING)
1111

1212
subprocess.call(['shutdown', '-h', 'now'], shell=False)

0 commit comments

Comments
 (0)