One problem is that your have a GOTO PUSHD...
if inches < 12 then pushd
... but your have a RETURN at the end of the PUSHD code.
Change your code to read...
if inches < 12 then GOSUB pushd
One problem is that your have a GOTO PUSHD...
if inches < 12 then pushd
... but your have a RETURN at the end of the PUSHD code.
Change your code to read...
if inches < 12 then GOSUB pushd
Thank you, but thats not the problem, there must be something inherinant to the ultrasonic sensor that wont let it infinite loop without being reset or something,
Can anyone tell me why after four object detects it goes off based on the code I provided?
If you have added the GOSUB, then your code is now good.
You could always check if RawDist=0 then light an Error LED, that way you can check if you are actually getting sensible results back from your Sensor.
Bookmarks