File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 77# Set the tap type: 1=single, 2=double
88cpx .detect_taps = 1
99
10- # NeoPixel settings
10+ # NeoPixel colors used
1111RED = (90 , 0 , 0 )
1212BLACK = (0 , 0 , 0 )
13- step_col = [RED ]
1413
1514cpx .pixels .brightness = 0.1 # set brightness value
1615
1716# The audio file assigned to the touchpad
18- audio_file = [ "imperial_march.wav" ]
17+ audio_file = "imperial_march.wav"
1918
20- def play_it (index ):
21- cpx .pixels .fill (step_col [ index ] ) # Light neopixels
22- cpx .play_file (audio_file [ index ] ) # play audio clip
23- print ("playing file " + audio_file [ index ] )
19+ def play_it ():
20+ cpx .pixels .fill (RED ) # Light neopixels
21+ cpx .play_file (audio_file ) # play audio clip
22+ print ("playing file " , audio_file )
2423 cpx .pixels .fill (BLACK ) # unlight lights
2524
2625while True :
2726 # playback mode. Use the slide switch to change between
2827 # trigger via touch or via single tap
2928 if cpx .switch :
3029 if cpx .touch_A1 :
31- play_it (0 )
30+ play_it ()
3231 else :
3332 if cpx .tapped :
34- play_it (0 )
33+ play_it ()
You can’t perform that action at this time.
0 commit comments