Commit de23c954 authored by santiago duque's avatar santiago duque

added second button and logic to stop events as a test

parent 67f79f7e
......@@ -125,7 +125,7 @@ setup_paths(False)
def btn_pressed(index):
global btn_array
global sound_playing
print('keeps pressing')
btn_array[index].when_pressed = None
btn_array[index].when_released = lambda: resetBtn(index)
......@@ -143,11 +143,12 @@ def resetBtn(index):
btn1 = Button(21)
btn1.when_pressed = lambda: btn_pressed(0)
btn1.when_held = lambda: print('keeps pressing')
btn1.when_held = None
#btn1.when_released = lambda: resetBtn(0)
btn2 = Button(13)
btn2.when_pressed = lambda: btn_pressed(1)
btn2.when_held = None
#btn2.when_released = lambda: resetBtn(1)
btn_array = [btn1, btn2]
......
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