My current difficulty isn't necessarily incorporating a rotary switch. My main issue is how to repeat the dispensing action. The way I have coded it is simply including a <= or >= argument which moves it in the appropriate direction if the angle is between min and max angles.
Is there a way to get the servo to repeat the action easily?