Servo Sweep with conditions

Your servo is being told to go to pos 0 and then move step by step to pos 180

               for(pos = 0; pos < 180; pos += 1)  
                {                                   
                  myservo.write(pos);              
                  delay(15);                       
                }

this tells your servo to go to pos 180 and then move step by step to pos 0

                for(pos = 180; pos>=1; pos-=1)     
                {                                
                myservo.write(pos);               
                delay(15);                        
                  }

So what ever reading you get it just move back forth!

Mark