Wave Shield

by ashapiro on Mon Mar 25, 2013 4:55 pm

I am using Arduino Uno to control various LEDs in different combinations. I also have a SD that I would like to play either before, during or after each loop without interrupting the flow of the main sketch. Please tell me how that can be done. If someone already has a sketch as an example, I would very much appreciating receiving a copy. Thanks for any help you can give me. I am the rankest of beginners.
Arthur
ashapiro
 
Posts: 17
Joined: Tue Oct 23, 2012 2:25 pm

Re: Wave Shield

by adafruit_support_bill on Mon Mar 25, 2013 7:39 pm

The WaveHC wave playback is 'interrupt driven'. What that means is that a timer generates an interrupt at regular intervals to play the sound through the Wave shield. This is all transparent to your program. You only need to start the playback by calling "playfile", then your program can go on to do other things such as controlling your LEDs.

There are many example sketches in the tutorial: http://www.ladyada.net/make/waveshield/examples.html
Under "6 buttons, 6 sounds, multiple possibilities!", the link named "Play the wave file all the way through once, but allow other buttons to interrupt" shows that the sketch is free to scan the pushbuttons while the wave file is playing.
User avatar
adafruit_support_bill
 
Posts: 25431
Joined: Sat Feb 07, 2009 9:11 am

Re: Wave Shield

by ashapiro on Mon Mar 25, 2013 10:18 pm

Thanks for the immediate response. I'll check out the examples in the link. I'm sure I'll be able to find the answer to my particular problem.

Arthur
ashapiro
 
Posts: 17
Joined: Tue Oct 23, 2012 2:25 pm