Easy to use code to measure PWM signals (<2.5Khz) plus a dedicated function to calibrate the input from an RC receiver, including fail-safe.