I am writing a bit of code for my DSLR camera to help when doing “Light painting”.
This is where I have the shutter open for 30 seconds and I am doing “second curtain flash”.
All the fuss is because I see the problem of pressing the shutter button, getting to the subject and doing the light stuff all the while counting down from 30.
This little box does some of the work for me.
At this stage I don’t have the RTC and may not really need it, but… Hey, It is an option.
Here is a walk through of what I want to happen:
The arduino boots, and it has 2 outputs to the camera. One to “focus”/“wake up” the camera and one to take the picture.
It has 3 inputs - for now. Two of the three start the sequence of taking the picture.
It has 2 x 7 Segment digits to count down and show time/s remaining.
On the arduino side of things:
3 pins for inputs.
4 pins for “7 segment display”
2 pins for digit selection (digit 1 and 2)
2 pins for the decimal points.
2 pins for the I2C bus if there is an RTC used.
I am using ClickButton to allow multiple functions from the 3 buttons/inputs.
I have really changed my way of writing code - included - from when I first started.
For the better? Dunno. But I am trying different ways and see which is better for me.
In the MENU / Set_Pre_time it reads the “key” value for what is pressed. One key increases the value, one decreases and the third “exits”.
I’m stuck how to do that. See code.
Sorry if it is a dumb question.
I have been out of the coding for a while and have forgotten bits of it and would appreciate a bit of help.
So to complete the walk through:
The arduino is waiting.
It seen either of the two inputs activate/trip/trigger/what ever.
It starts to count down and displays the time on the display.
While this is going on it looks and sees if a button is pressed.
If a button is pressed, it aborts taking the picture.
Otherwise it goes on, and takes the picture.
After that, it starts a count down from 30 (seconds and displays it on the screen/display.
Then it goes back to waiting.
I may include a bit of code so even after the photo has been started, if something goes wrong, I can reset the counter.
Academic for now, so I won’t worry about it.
Also, in the “Display_Time” it is a bit … long (?) in how I did it.
It has to translate the value into the binary and send it out the pins.
Is there a trick how to make it a bit smaller?
“arrays”? for instance?
When you look at the code, the thing to load is called “V1”. (That to me is “Version 1” of the code.)
Thanks in advance.
Camera timer V1.zip (2.68 KB)