wait_for_t0:
if portb.0= 0 then wait_for_t0 ' loop until rssi goes high
pulsin portd.4,1,PLENGTH1 ' MEASURE TIME C2 IS HIGH AND STORE
IF PLENGTH1 > 255 AND PLENGTH1 < 270 THEN COUNTPULSes ' 42 usec error allowed
Pulsin, you have a "1". that means you are waiting for a HIGH pulse in order to get out of your loop:
Since the high is already over with, you are not measuring that first "Pulse" You are losing that pulse and measuring the next one.
Dwayne
Last edited by Dwayne; - 16th September 2005 at 17:34.
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Bookmarks