Commit be12e614 authored by santiago duque's avatar santiago duque

added second button and logic to stop events as a test

parent f52d9ebb
...@@ -54,6 +54,8 @@ def play_sound(index): ...@@ -54,6 +54,8 @@ def play_sound(index):
global channel global channel
global sound_array global sound_array
print('play func called')
if not cut_current_sound: if not cut_current_sound:
current_sound_index = index current_sound_index = index
channel = sound_array[current_sound_index].play() channel = sound_array[current_sound_index].play()
...@@ -123,7 +125,9 @@ def btn_pressed(index): ...@@ -123,7 +125,9 @@ def btn_pressed(index):
def resetBtn(index): def resetBtn(index):
global btn_array global btn_array
btn_array[index].when_pressed = lambda: play_sound(index)
print('btn released')
#btn_array[index].when_pressed = lambda: play_sound(index)
btn1 = Button(21) btn1 = Button(21)
btn1.when_pressed = lambda: btn_pressed(0) btn1.when_pressed = lambda: btn_pressed(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment