I have written my own coding and got the output in serial terminal window in Program editor for the PART III GET A GRIP. my problem is that how i can differentiate a cup from other object and make the robot understand it. kindly help me i searched the website but i was not able to get it. kindly help me with the code for " how i can make my robot understand that its a cup in front". i am using PICAXE 28 and SRF005
symbol trig = 3
symbol echo = 6
symbol range = w0
symbol range1 = w1
main:
servo 0,75
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,85
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,95
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,105
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,115
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,125
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,135
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,145
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,155
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,165
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,175
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,185
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,195
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,205
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,215
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
servo 0,225
pause 10
pause 10 ' this should not be nesecary, but it was of some reason in my setup
low portc 0 ' this should not be nesecary, but if not, strange things hapened
pause 10 'this should not be nesecary, but that is what makes it all fun
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10
range = range*10/58
range1 = range
if range > 10 then
for b1 = 1 to range1
sertxd ("|")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
else
for b1 = 1 to range1
sertxd("n")
if b1=range1 then
sertxd("+")
endif
next b1
sertxd(13,10)
endif
goto main