Put a capacitor in series with the LED‘s current limiting resistor.
C = t/R where R is the LED’s current limiting resistor, and t is the length of the flash.
(Also put a diode in inverse parallel with the LEDs so that the capacitor can discharge)
[/QUO
Ok so to clarify it’s supposed to simulate gunfire so the switch that’s closed is on the trigger so the person firing it can hold the trigger down for as long or as short a time as he/she sees fit. But the muzzle flash LED has to be just that a bright flash. But the gun can be fired three times in quick succession but the LED must still only be a bright flash each time. The interval between the switch being closedand opened and closed again can never be shorter than the LED flash as it’s a millisecond flashI am having a lot of trouble working out just what you want. I get the idea you want an LED to flash on the press of a momentary switch, and I think you want it to ignore the switch until it is released and pressed again.
The part that is unclear is the behavior you want when the switch is pressed repeatedly in a short time, and just what is wrong with the current approaches in getting that. Could you right a little narrative for each case to clarify:
1) Switch pressed and released with a long pause.
2) Switch pressed and released, then pressed again in a short interval.
If there is a difference between the behavior if the interval is shorter than the duration of the flash, what is it?
by Duane Benson
by Jeff Child
by Jake Hertz
by Aaron Carman