Haha, missed the promise. THX.
I put the code in the wokwi and wired up a servo that they have.
Here I added
unsigned long interval = 5000; // 5s (testing) or 160s (2m40) KA photos interval
even though your logic assures a value will be assigned, putting one in the declaration means no accident will ever land you up with a zero for the interval. A bigger deal in different circumstances and def a belt added to the suspenders. Cheap enough.
Where do the trigger signals come from and how long do they last?
By timing my press of the trigger just right, I can get three servo sweeps, one KA and the double tap for Video.
There does seem to be a bit of delay between the two, is this enough for the CUBE?
By pressing it for "not long enough" during the KA sweep, you miss the video start.
In a similar vein, after the video it seems possible that a KA photo will follow very closely. Again, this may be OK, don't have a CUBE to test!
This
// Brief delay (as seen in others' sketches), although could probably
// be even shorter (1ms for stability?) as there is no bouncing involved
delay(100);
delays the KA photo for 100 ms, which may be enough. If it isn't enough, merely increasing it would slow your whole loop down, so instead I suggest that right after the video end pulse, you scoot forward the KA timer
previousMillis = millis();
which will postpone the next KA photo for the interval it is timed against. Maybe the variable should be named intervalKA or something, just sayin'.
Lastly, sry, but the LED has to be KA blue! Who signed off on this late change? ![]()
a7