Re: A6500 High Speed Capture With Flash - Issue With Delayed Flash (Need Help W/Program)
boblug wrote:
I would comment out the led lines. Not sure why they are needed.
Also move the digitalwrite(flash, low) before the loop and add a copy of this line before the end of the loop.
Move the digitalwrite(soundsensor, high) before the loop also
in the if statement comment out the first delay and change seconf delay to 50 milliseconds.
This should remove a little of the time delay and keep your sensor as close as possible.
I'm not sure exactly what the deal is with that "give flash time to settle down" delay is.
I'm also not entirely familiar with the Arduino environment/IDE - all of my work with Atmel AVR controllers has been via avr-gcc.
If I were doing this:
I'd choose an AVR that had analog comparator interrupts available - http://www.avr-tutorials.com/comparator/utilizing-avr-analog-comparator-interrupt-feature
This will let you immediately change the output pin state when the interrupt executes.
A "typical" trick I use with most AVR projects is to have a timer/counter intterupt configured to trigger periodically, often at 1 kHz. This is used for less time-sensitive housekeeping - for example, set a variable inside your analog capture interrupt to indicate that a trigger event started. In the timer/counter interrupt - count a certain number of ticks of said interrupt once the "event started" flag was set before unsetting the trigger output pin.
TBD how to handle the "lock out another flash for X seconds" situation - multiple possibilities here.
-- hide signature --
Context is key. If I have quoted someone else's post when replying, please do not reply to something I say without reading text that I have quoted, and understanding the reason the quote function exists.