# Make Grover wave his right hand up and down forever

8000 0 servo # left leg down
4000 1 servo # left arm down
4000 2 servo # right arm down
4000 3 servo # right leg down
moving_wait

begin
  30 2 speed      # decrease right arm speed
  8000 2 servo    # raise right arm
  moving_wait     # wait until arm stops is raised
  60 2 speed      # increase right arm speed
  4000 2 servo    # lower right arm
  moving_wait     # wait until arm is lowered
repeat
quit 

# Subroutine that will delay until all servos have stopped
sub moving_wait
  begin
    get_moving_state
  while
    # wait until no longer moving
  repeat
return