Hello,
I am currently writing a sketch that controls my DLSR (exposure control for timelapse), currently, in pseudo-pseudocode, it looks like this:
if (num_img < max_img) {
if (can_wait) { //Waiting between images
display_wait();
delay(delay_wait);
}
if (can_sva) { //mirror-lockup
display_sva();
open_shutter();
delay(delay_sva);
} else {
if (can_exp)
open_shutter();
}
delay(500 ms);
if (can_exp) //can_exp is true if the arduino controls the duration of the exposure, not the camera
display_exp();
open_shutter();
delay(delay_exp);
close_shutter();
} else {
open_shutter();
delay(50 ms);
close_shutter();
}
delay(100 ms);
move_motors(axis1, axis2); //motor-library uses a delay and whileloops, I'm currently trying to rewrite this too, so it no
//longer blocks, but the duration of this can take an unknown time, so I'm rewriting it, that
//it returns a flag depending whether the movement is finished or not.
num_img++;
}
How can I replace the delays so it doesn't block anymore?