Modification of a timelapse program

I use very successfully the program MiniEngine1 by Eiric Lenz ( GitHub - airiclenz/miniEngine1: An Arduino based single-axis motion-control system for time-lapse photography (the legacy version) ) to control a camera (focus and shutter triggering) and the stepper motor of a slider.
I would like now to also control a studio light installation that would turn on slightly before each camera shutter triggering.
Since I don't really use the focus fonction, I used the focus pin to control a relay board.
It works fine BUT it turns "on" the light at the same time than triggering, despite the setting, "focus time" and "focus behavior" in the menu.
I am about to try to add delay() in the camera_shoot() function (mE_camera.ino file, line 55).
What do you think of it ?
Surely the most "elegant" thing would be to add a new pin attribution, a "light_on" function and more line in the setting menu to set the delay between "light on", "camera focus" and "camera shoot".
I hope that subject could find some competent and helpfull mind.

The easier you make it to read and copy your code the more likely it is that you will get help

Please follow the advice given in the link below when posting code , use code tags and post the code here

If the git was less than two years old, I’d say you’d get further faster opening an issue or asking the author…

At a glance, it looks more like line 69 to me. After the focus bit is adjusted, but before the shutter is open.

But just plopping delay into what is quite an elaborate program might mess up all kindsa timing of critical and less critical nature.

How long a short bit of time do you need? It seems like you could go ahead and try, what’s the worst that could happen?

If it appears to work, carefully check that all the other time based operations have not been compromised… you might get lucky.

If it doesn’t work at all or screws with the time lapsing accuracy, there is little choice but to take a longer route which will involve learning way more about the entire program than, well let’s just say you might want to open alternate channels of inquiry about the program or how to do what you want.

Can you get faster lights? Can you exploit a delay until camera actually takes a picture in the camera itself? And so forth, up to and including switching careers. :wink:


Thank you for your answer. I should have start the previous message, by explaining that my coding skills are close to zero. I have a vague and intuitive comprehension.
As you say, I will go ahead by next week and let you know. I need between 1000 ms and 500 ms delay, and since it's to shoot plants growth the shooting cycle will be very long, the delay shouldn't make a big difference.
What do you mean by "switching careers" ? I hope I am a better photographer than coder...

I am sorry to not have add the code in my message, but the whole program is constituted of 9 files , and the zip is to heavy to be upload. That 's why I give the github adress of the program :

With something so large and spread over tabs like it is, I personally don't have a problem looking at it on github. Others might.

But add the fact that it is built for an earlier IDE version and you might find few takers for diving into the code - we usually see relatively simple programs, or problems exposed through small examples... not a large program from a non-programmer.

I have a vague and intuitive comprehension.

That's a good start for setting out on a long journey. I still find common sense, intuition and sometimes extra-sensory things entering into my own progress. And I am pretty vague most of the time.

As for switching careers, it was an attmept at humor, which like so many I try apparently did not land.


I got it , and my answer was an attempt too for humor. I suppose my english is not good enough for too much subtility.
Anyway thank you very much for your help. No doubt that project would be a good brain exercice for me, but I have first to learn the very basics and as an impatient piano learner, I would dream to be able to play a Bach invention after a week, a Mozart sonata after two weeks and a Beethoven concerto after a month...
and finally put a Rubinstein recording in my CD player.