Think about your loop.
If you have defined "time" – let's say you set it to 1 before the loop – the first time through the loop, you delay 1uS. The second time, you delay 2uS, then 3, 4, 5, etc. This
is not what you want. If you want 1uS resolution, the delay statement should be
The variable Time keeps track of the number of times through the loop.
Time represents, in this case, the number of uS of reaction time. What units do you want for the display? Probably mS, which is uS/1000.
To get the integer number of mS:
Code:
TimeIntegerPart = int(time/1000)
If you want to display the fractional part (i.e., the remaining uS), you need to subtract the integer number of mS from the Time variable to be left with the remainder of uS.
Code:
TimeFractionalPart = Time - (TimeIntegerPart * 1000)
//TimeIntegerPart * 1000 = the whole number of mS in Time
If you manage to get this far, all that's left is to display it.
Code:
LCD.Write (DecToStr(TimeIntegerPart), ".", DecToString(TimeFracrionalPart))
I don't remember the exact syntax for writing to an LCD, but the above gets you the numeric part.