adding an extra parameter

Hi everyone, I am currently working on a timelapse controller / intervalometer.

at present I have it working so that when switched on it first requires input of the number of photos to be taken, then the interval inbetween the photos.

I have been using the code and hardware as shown here

http://www.trevorshp.com/creations/intervalometer.htm
I am wanting to add a shutter speed option so that the work flow would go: On -> number of pics -> shutter speed -> delay -> start

im not 100% sure where this would need to be inserted or how, any help would be great

heres the code

intervalometer_with_buttons_and_lcd.ino (9.65 KB)

Hi everyone, I am currently working on a timelapse controller / intervalometer.

at present I have it working so that when switched on it first requires input of the number of photos to be taken, then the interval inbetween the photos.

I have been using the code and hardware as shown here

http://www.trevorshp.com/creations/intervalometer.htm
I am wanting to add a shutter speed option so that the work flow would go: On → number of pics → shutter speed → delay → start

im not 100% sure where this would need to be inserted or how, any help would be great

intervalometer_with_buttons_and_lcd.ino (9.65 KB)

Hey cross posting is naughty don't do it.

I would make the code to set shutter speed similar to the code to set number of pics.

(I understand this is not code you’ve written. If you can’t follow how the existing code works, your chances of successfully making this change are pretty slim.)

I understand the majority of what's going on this is probably my 4th or 5th reasonably major arduino project, I had started this myself originally but found this code which was pretty much exactly what I was looking for. I was thinking along the lines of how the picture was setup, I've never used changeable parameters prior to the loop so although I can see what it's doing I'm not 100% how I should structure it with another variable.

A pseudo code example from the picture option through to the beginning of the loop would be really helpful

Sorry I wasn’t sure which board would be my best bet, I’ll stick to the programming board :slight_smile:

I understand the majority of what's going on

Apparently, you don't, or you would be able to implement PeterH's suggestion.

Post the code that you think is getting the number of pictures to take. If you can do that, and you can identify how/where it is getting the interval between the photos, then adding another section to get delay between pictures is trivial.

The function names that are used, while not what I would have chosen, are a pretty good indication of what the program is doing.

Hacking projects and figuring stuff out is part of the fun. But to get you started:

It appears that the guy uses this code to input the numPics. You need to adapt it so you can input a new variable (such as shutterTime).

  while (changeNumPics){
      oldNumPics = numPics;
      checkUp();
      checkDown();
      Serial.println(numPics);
      if (oldNumPics != numPics){
         if (numPics == 0){
           displayINF();
         }
         else{
           displayDEC(numPics/10);
         }
      }
      if (millis() - numPicsChanged > numPicsTimeout){ 
        changeNumPics = false; 
      }

Then later in the code change this:

//take a picture
digitalWrite(shutterPin, HIGH);
digitalWrite(ledPin, HIGH);
delay(waitTime);
digitalWrite(ledPin, LOW);
digitalWrite(shutterPin, LOW);
count++;

to delay(shutterTime);

Good luck.

Merged to save anyone else responding twice and wasting their time.