About that lag and not being sure which lights it might be triggering on (initial flash or beginning of marquee lights), can you program them so that the first time around 1 is lit at a time, then 2, then 3, etc? Then you could determine how far into the sequence the event things have traveled. Or keep the first one lit the first cycle, then the first 2 remain lit the second pass, etc.
Or maybe I'm not quite understanding why you can't tell what is initiating the motion-detect from which to start taking the time measure.
You probably didn't but that's okay.
My concern was that my "lightning" might be too puny to always trip the MD threshold, possibly giving a longer lag than a real lightning might. But I already pretty much verified this wasn't the case.
The "problem" I described could of course exist in jonnythe's program as well, but to a lesser extent since his flash is more pronounced than mine (entire screen flashing versus my two LEDs in a corner). I have 10 seconds between two flash sequences, there's no need to alter the sequence from run to run, they can't possibly be mixed up.
My point was that if the motion detection fails to notice the 55 ms (or 20 ms by default in jonnythe's program) flash, it will eventually notice the timing steps and start the process of shooting later. When shooting lightnings, it doesn't really make a difference what the reason for lag variations is (i.e. is it in speed of detection or shutter lag etc.), as long as the total lag is short enough.
But it's important to pinpoint where the lag is to verify which part of the code needs to be looked into the most and to fully understand how this will affect other situations apart from lightnings. Think about shooting something which actually only moves for a really short time like 30 ms. There will be no timing measurement bars or LEDs to trigger from if the motion detect fails to notice the twitch (I can think of setups where MD would be useful for detecting twitches too short to be photographed just to increment a counter on display... but you'd need to be able to rely on MD always detecting a twitch and to rely on it, it's limits need to be determined).