micromouse Atmega32 programming

Thread Starter

chinmayacn89

Joined Jan 7, 2010
3
hi..am doing micromouse(maze soler)....
my hardware is almost complete.... i have used ATmega32L ,3 TSOP sensors,stepper motor and ULN2803 as motor driver...plz send the programme code or the link for it....
 

beenthere

Joined Apr 20, 2004
15,819
We would have to have your exact hardware in hand as a complete schematic before it would even be possible to determine how the project could be coded.

Along with the schematics, the maze-solving algorithm you intend to employ will also be needed.
 

subarna

Joined Feb 16, 2010
3
you should use flood fill algo.....

but flooding distance is too old concept you should flood time to travrse fastest..

i made it resently....
 
Last edited:

subarna

Joined Feb 16, 2010
3
hi..am doing micromouse(maze soler)....
my hardware is almost complete.... i have used ATmega32L ,3 TSOP sensors,stepper motor and ULN2803 as motor driver...plz send the programme code or the link for it....
which algo u r using and for where ??

i can help u
contact me at <snip>

Moderator's note: We insist that all questions and answers be made in the public forums.
 
Last edited by a moderator:

subarna

Joined Feb 16, 2010
3
[SIZE=+2]E[/SIZE]very time the mouse arrives in a cell it will perform the following steps:​
(1) Update the wall map
(2) Flood the maze with new distance values
(3) Decide which neighboring cell has the lowest distance value
(4) Move to the neighboring cell with the lowest distance value



First of all made wall_map();


Update the wall_map():
Is the cell to the North separated by a wall?
Yes -> Turn on the "North" bit for the cell we are standing on and
Turn on the "South" bit for the cell to the North
No -> Do nothing
Is the cell to the East separated by a wall?
Yes -> Turn on the "East" bit for the cell we are standing on and
Turn on the "West" bit for the cell to the East
No -> Do nothing
Is the cell to the South separated by a wall?
Yes -> Turn on the "South" bit for the cell we are standing on and
Turn on the "North" bit for the cell to the South
No -> Do nothing
Is the cell to the West separated by a wall?
Yes -> Turn on the "West" bit for the cell we are standing on and
Turn on the "East" bit for the cell to the West
No -> Do nothing







Flood the maze with new distance values:

Let variable Level = 0
Initialize the array DistanceValue so that all values = 255
Place the destination cell in an array called CurrentLevel
Initialize a second array called NextLevel
Begin:
Repeat the following instructions until CurrentLevel is empty:
{
Remove a cell from CurrentLevel
If DistanceValue(cell) = 255 then
let DistanceValue(cell) = Level and
place all open neighbors of cell into NextLevel

End If
}

The array CurrentLevel is now empty.
Is the array NextLevel empty?
No ->
{
Level = Level +1,
Let CurrentLevel = NextLevel,
Initialize NextLevel,
Go back to "Begin:"
}

Yes -> You're done flooding the maze




Decide which neighboring cell has the lowest distance value:
Is the cell to the North separated by a wall?
Yes -> Ignore the North cell
No -> Push the North cell onto the stack to be examined
Is the cell to the East separated by a wall?
Yes -> Ignore the East cell
No -> Push the East cell onto the stack to be examined
Is the cell to the South separated by a wall?
Yes -> Ignore the South cell
No -> Push the South cell onto the stack to be examined
Is the cell to the West separated by a wall?
Yes -> Ignore the West cell
No -> Push the West cell onto the stack to be examined
Pull all of the cells from the stack (The stack is now empty)
Sort the cells to determine which has the lowest distance value

Move to the neighboring cell with the lowest distance value.
make a move_robot();

 
Top