Help with some programming!!

Ok let me explain the code better:

user enters the following information using pushbuttons into a LCD display:

  1. Feedinterval; this sets the interval between each feed and ranges from 2 -4. So if 2 is entered, then feed interval will be 12 hrly, 3 - 8hrly and 4 - 6 hrly
  2. number of days for the feeding to continue. ranges from 1 to 10. SO if 2 is entered, then feeding will go one for 2 days etc
  3. timefor first feed (this part will only come into play after I have worked on the existing problem)

So lets have a scenario: user inputs feedinterval= 2 and numberofdays = 2:
The servo will rotate a total of 2 times per day; so 4 times for 2 days..

For testing purpose, I cant wait for 12 hr interval. So I am testing with 12 sec interval instead.

SO the problem is I am not able to stop the servo from rotating even after the condition stated in the for loop has been satisfied..