for the first code
while (digitalRead(leftbutton)) //while the button is being pressed
{
myservo.write(pos); //rotates servo to its current positon
delay(delaytime);
pos-=1; //position becomes one less
}
myservo.write(pos); //after the button stops being pressed the servo is at pos
previousmillis = millis();
if(millis() >= 8000UL) //if the total time - the start time is greater than 3 sec
{
//casenum = 1; //this is where the code goes wrong, it seems like it reads this if statement
//and immedietly say thinks its true
//previousmillis = currentmillis;
//interval = interval + millis();
break;
}
but for the second part, I thought the same thing, but with the -5000 on the left side of the inequality delays the panning for 5secs which doesn't make since to me