SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By ERikFAdderall
#201201
I just got the Sparkfun/Robertsonics WAV Trigger board. I went through the documentation and started using the WAV Trigger Init File Maker v1.20 to set it up. I am trying to set up trigger 1 to work with a tilt switch and to play a specific track while that switch is active and stop when it the switch is open. Following the directions I setup Trigger 1 as
HARWDARE INTERFACE: Contact Closure TYPE: Level FUNCTION: Normal
According to the user guide this will setup trigger 1 to play the CORRESPONDING track to play as long as the contact is closed and stop playing when released. So what is the corresponding track? Is it trigger 1 plays 001 and trigger 2 plays 002, etc.? I though you could load up to 4096 files, far more than the number of triggers. I see a way to set a track range for random settings but how can I specify which track corresponds to which trigger?
This is what the INIT file maker outputs.
#SPKR 1
#TRIG 01, 1, 0, 2, 0, 1, 1, 0, ,
Does one of the numbers in that #TRIG string control the track number played?

What I am trying to do is have a specific track play when the tilt switch is closed and continue playing until the switch is open again. It should play that same track each time the switch is closed and continue playing until switch is open again. Ideally, it would continue playing from the same point it last stopped but that is not critical.
I would like to have a second track play (polyphonic) over the trigger 1 track when a motion sensor is activated. This track should also only play as long as the motion PIR sensor is active. Is there a way to insert simple logic that says the second track can only play if the first track is active? Can I set it so that trigger 1 needs to be in closed state for trigger 2 to play? Or that somehow trigger 2 is only active if trigger 1 sound or any sound is playing?

Thanks in advance for any help.
User avatar
By robertsonics
#201207
I have extremely limited internet access for the next 2 weeks and am typing on my phone, so I apologize for the brevity. By default, the triggers play the corresponding track numbers. Trigger 1 plays the filename starting with "001...". I suggest you go through the hookup guide to learn those basics.

Level type triggers will do what you want - the track will play only as long as the trigger is active. It will always start at the beginning, however. You can use another trigger to pause and resume.

If you need complex logic like only playing when another track is playing, you'll need to write your own logic on an Arduino and use the serial protocol to control when and how the audio plays.

I encourage you to go through the hookup guide, and then experiment with the different trigger settings to learn how they work.

Hope this helps.