Thanks, i understand what you mean but getting it done is still not easy for me.
I changed the code to:
void loop()
{
for(int shot = 0; shot < TotalShots; shot++)
{
for(long steps = 0; steps < pos; steps++)
{
stepper.moveTo(pos);
stepper.run();
Serial.println(steps);
}
Serial.println("number of shots");
Serial.println(shot+1);
// delay(1000);
// digitalWrite(SHUTTER_PIN, LOW);
// delay(2000); // take shot
// digitalWrite(SHUTTER_PIN, HIGH);
}
while(true) {} // execution does not proceed past this point
}
A part of the serial print gives me the flowing output:
7158
7159 (latest step of first turn, witch is correct)
number of shots
1 (first shot)
0 (first step of the second turn)
1
and so on.
What seems correct, but when i delete the serial.println lines the stepper is just moving a few steps and than stops. Any ideas what goes wrong?