0-5V Ramp Output

ok i see.

In Pin 12 and 13, i connect 2 PWM signal, and i want to measure how long is the pulse.

If i use your language, measure time between when pulse goes High and when it goes Low.

With this time i want to build a ramp output that will provide a 0-5V

example :

if time < 1000usec. output will be 0Volt
if time > 2000usec. output will be 5Volt
if time is about 1500usec. output will be around 2.5Volt

hope it is more clear now =)