Loading

Report as inappropriate

After using the sketch for a while I did some changes to optimize long time exposures. I added longer times (up to 30 Seconds) and there was one issue I had to fix:
The shutter was released, almost simultaniously when the movement starts - not good for my purpose. Here the changed funktion „movieTimelapse“.
The funkton „timeToShoot“ is just renamed to „timeToMove" for a better understanding.

void moveTimelapse(){

// Move first, than release the shutter

if (timeToMove()) {
while (!calculatedPositionReached()) {
//// MOVE ///
if (!readLeft) {
digitalWrite(stepPin, HIGH);
//delayMicroseconds(350);
digitalWrite(stepPin, LOW);
delayMicroseconds(500);
stepsFromEndstop++;
}
}
delay(500); // wait a moment for no vibrations
releaseCamera();
shotsTaken++;
drawProgressBar();
}

if (readLeft || readRight || shotsTaken >= videoDuration * fps || stepsFromEndstop >= steps) {
running = false;
digitalWrite(enable, HIGH);
shotsTaken=0; // reset value for next timelapse
drawLowerTimelapseScreen();
}
}