Skip to content

Commit

Permalink
Add an option to switch between inputs with third key on Waveshare's hat
Browse files Browse the repository at this point in the history
  • Loading branch information
onlaj committed May 6, 2022
1 parent 9136aa0 commit 756eb6a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,16 @@ def start_webserver():
time.sleep(0.01)
if GPIO.input(KEY3) == 0:
midiports.last_activity = time.time()
if ledsettings.sequence_active:
if ledsettings.sequence_active == True:
ledsettings.set_sequence(0, 1)
else:
active_input = usersettings.get_setting_value("input_port")
secondary_input = usersettings.get_setting_value("secondary_input_port")
midiports.change_port("inport", secondary_input)
usersettings.change_setting_value("secondary_input_port", active_input)
usersettings.change_setting_value("input_port", secondary_input)
fastColorWipe(ledstrip.strip, True, ledsettings)

while GPIO.input(KEY3) == 0:
time.sleep(0.01)
if GPIO.input(KEYLEFT) == 0:
Expand Down

0 comments on commit 756eb6a

Please sign in to comment.