Add Sonar Range values to Serial Telemetry Output

Hi there,
Looking for a solution to add the value of a sonar range from PIN54 (PWM value) to the Serial Output SR1 or SR2. So I can add it on my OSD panel.
At least, I’m looking for any idea on how to integer a value in the serial telemetry output ?

Thank you.