Change Pin Layout
This commit is contained in:
parent
aecaf6e9ba
commit
93e01cd7f8
1 changed files with 4 additions and 4 deletions
8
main.py
8
main.py
|
@ -24,14 +24,14 @@ strip_blinker.begin()
|
||||||
strip_animation.begin()
|
strip_animation.begin()
|
||||||
|
|
||||||
# Button and switch GPIO setup
|
# Button and switch GPIO setup
|
||||||
button_pin = 18
|
button_pin = 16
|
||||||
toggle_switch_left_pin = 15
|
toggle_switch_left_pin = 20
|
||||||
toggle_switch_right_pin = 14
|
toggle_switch_right_pin = 21
|
||||||
|
|
||||||
# Cleanup GPIO to avoid "channel already in use" errors
|
# Cleanup GPIO to avoid "channel already in use" errors
|
||||||
GPIO.cleanup()
|
GPIO.cleanup()
|
||||||
|
|
||||||
GPIO.setmode(GPIO.BOARD)
|
GPIO.setmode(GPIO.BCM)
|
||||||
GPIO.setup(button_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
|
GPIO.setup(button_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
|
||||||
GPIO.setup(toggle_switch_left_pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
|
GPIO.setup(toggle_switch_left_pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
|
||||||
GPIO.setup(toggle_switch_right_pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
|
GPIO.setup(toggle_switch_right_pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
|
||||||
|
|
Loading…
Reference in a new issue