Timer1 for pulse period meaurement (ping mem)

rossco_50:
If I reset the pulsecount to 0 in the loop, the interuppt doesn't execute until a pulse is generated. However, time1 and time2 are returned directly after the first trailing edge i.e. I fire a one shot pulse and the loop completes by printing the same time value for both times.

Can anyone see where the IF statement is going wrong?

Looks to me in your code you set time1 twice and never set time2. Typo? Also, except for the first if, the next three ifs don't have an else, so I'd think you'd just go through all of them after the second pulse, bingo bango bongo.

Joe