Alert Bot 2.1

prajesh828

New Member
Hi M new here m doing a project on alrtbot 2.1. Using picaxe 28x2.

I'm solving a maze with it. Now it almost clears the maze. But m not satisfied. Is there any program that you can write so the robot can clear any maze?

I have wrote the program for this particular maze.

Here is the program


pwmout pwmdiv4, C.1, 99, 320
pwmout pwmdiv4, C.2, 99, 315


symbol swL=pinc.4
symbol swR=pinc.7
symbol counter=b10
counter =0

main:

forward a: forward b

if swL=0 then
gosub check
gosub turnR

elseif swR=0 then
gosub check
gosub turnL

endif


goto main


`------------------------------------------------
check:
pause 200
if swL=0 and swR=0 then
gosub driveback
counter=counter+1
gosub turn `----side turn
endif
return


driveback:
backward a: backward b
pause 600 `----------
halt b : halt a
return


turn:
if counter <4 then
gosub L90
elseif counter <6 then
gosub R90
elseif counter =6 then
stop
endif

return


turnL:
forward a : backward b
pause 200
halt a : halt b
pause 100
return

turnR:
forward b : backward a
pause 200
halt b : halt a
pause 100
return

L90:
forward a : backward b
pause 1000
halt a : halt b
pause 200
return

R90:
forward b : backward a
pause 1000
halt b : halt a
pause 200
return

but if i my robot was put into another one it won;t solve that maze. So what can i do to make it solve any given maze? Use of infrared or sensors or cds?
 

techElder

Well-known member
This doesn't sound like a finished project. Should have posted it on the main forum to get a discussion going.
 

nick12ab

Senior Member
Can you use code tags when posting code like this: - not that it helps much as you've hardly used any white spacing at all.
Code:
pwmout pwmdiv4, C.1, 99, 320
pwmout pwmdiv4, C.2, 99, 315


symbol swL=pinc.4
symbol swR=pinc.7
symbol counter=b10
counter =0

main:

forward a: forward b

if swL=0 then
  gosub check
  gosub turnR
  
elseif swR=0 then
  gosub check
  gosub turnL

endif


goto main


`------------------------------------------------
check:
pause 200
if swL=0 and swR=0 then
gosub driveback
counter=counter+1
gosub turn      `----side turn
endif
return


driveback:
backward a: backward b
pause 600       `----------
halt b : halt a
return


turn:
if counter <4 then
 gosub L90
elseif counter <6 then
 gosub R90
elseif counter =6 then
 stop
endif

return


turnL:
forward a : backward b
pause 200
halt a : halt b
pause 100
return

turnR:
forward b : backward a
pause 200
halt b : halt a
pause 100
return

L90:
forward a : backward b
pause 1000
halt a : halt b
pause 200
return

R90:
forward b : backward a
pause 1000
halt b : halt a
pause 200
return
As well as it being in the right forum, more information on your hardware setup is needed - a schematic. What is this 'alert bot'?
 

erco

Senior Member
Judging by the use of pseudo commands forward, backward, halt, etc, I'm guessing this is for Rev Ed's 20X2 Microbot, aka Bot 120?
 
Top