reading pwm

i will take a look , thanks,

i have another question which might be resolved in your code,
but how can i control the servo via the arduino? i mean i have a led, with a 0-255 pwm signal based on stick position, so i have effectivly got a dimmer ,its all nice an all, but i want to know if i can manipulate the original servo pwm signal and then send it out to the servo, i know its possible with arduino because there are arduino based UAV´s all over the show,