Hello Everyone!
I have posted my code in the attachement below which I have been using to measure pulse widths for 5 to 15 microsecond pulses. I am giving pulses from function generator with 1 or 2 Hz frequency. But my code makes one count every four microseconds so it measures pulse widths if the pulse is 4 microsecond or 8 or 12 and so on but not the values in between , for example for 10 microsecond pulse it measures either 8 or 12. I thought of using a external fast counter to improve get the accuracy but I have come to know that 16 MHz clock of arduino is more than enough to get the right results so if someone can help me out here with my code I would be extremely grateful to all of you.
Thanks all in advance!
