@Robtillaart yes I have used the code with unsigned int the output of the code is given below, I have applied constant pulse stream at 1Hz frequency and changed the input from 10 to 13 and then 15 microsecond. I have connected the ground as well but did not use pulldown/up resistor.
