I wish to use the attached code to run my robot as an Obstacle Avoider. a run check on the code stops at CODEavgDistance =0/CODE and I am unable to find the solution.
This is on an Raspberry Pi 3 B with latest Rasbian O/S.
CODEprint ("right")
stop()
count=0
while True:
i=0
avgDistance=0
for i in range(5):
GPIO.output(TRI G, False) #Set TRIG as LOW
...