Need help getting IR sensor to trigger Servo motor

(the one in your example 'pseudo code')