In the first build, I used a mechanical switch to trigger the sound board to play the audio file, and the 'trinket' processor to run a 'flashing' program for the laser. The laser output needed to go to a 'positive' switch transistor, and the soundboard trigger went to ground 'mechanically.'
In this second project, I programmed the trinket to fire two pins nearly simultaneously (as fast as the program steps can run). Unless you modify the pin registry, you really can't get two output pins to fire at 'exact' same time. Additionally, and this is the important part, the pins have different functions, and cut off at different times. The INPUT trigger(from the mechanical gun trigger) is still the same on pin4. I used some basic C++ low level programming through an arduino IDE. Took a few hours, but worked out in the end.
So basically, trinket output pin 1 will run for 50ms constant on, and immediately after pin1 initiates, pin 2 initiates and runs on-off-on-off-on-off for just a bit longer. There is still a minute delay between pin 1 and pin2 firing off, but I used this to my advantage because it takes a minute delay to run the WAV file on the soundboard..so in essence, the final audio and visual outputs are at the same time. You can see in the video how the red led on the trinket stays on (running off pin1, which also triggers the soundboard) and the blue led flashes at same time (running off pin2).
To run the negative ground, I built a simple transistor switch with 5v pin 1 output through resistor to base, and emitter and collector running soundboard output negative to a ground. This is much faster than the 'mechanical' switch on prior build. I built another transistor switch to operate the laser as well, since the laser pull more amps than the trinket can supply(only something like 5v 20ma per pin).
If you look at the second pic, you can see all the break-out boards. These include , from top left to right:
5v adjustable voltage regulator (maybe ~1amp output max)
Trinket processor
Power on-off switch board (VERY minimal draw in off position..super unit works great with remote momentary switch)
18 watt amp with heat sink. Mono. Exscellent unit from China..something like 5 for 15$ shipped)
Momentary switch, w/internal led lights up in blue
Transistor switch (on = through to ground) VERY easy switch to make. 'trigger' Resistor to base.
Transistor switch for components requiring more amps. 'trigger' resistor to base.
Final component is the adafruit 2mb sound module (this is most expensive component at 20$, all other components cost no more than 30$ including the laser)
So this build is going to be easier with smaller components and better sound/light action.
Build Vid:
https://www.youtube.com/watch?v=kiWua45Y2acThere are MANY uses for this tech on our builds, and it adds a new dimension to one's knowledge base.