Measure Pwm Arduino, 5Khz) plus a dedicated function to calibrate the input from an RC receiver, including fail-safe.