micromouse Atmega32 programming

Discussion in 'Embedded Systems and Microcontrollers' started by chinmayacn89, Jan 27, 2010.

  1. chinmayacn89

    Thread Starter New Member

    Jan 7, 2010
    3
    0
    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....
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    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.
     
  3. subarna

    New Member

    Feb 16, 2010
    3
    0
    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: Feb 16, 2010
  4. subarna

    New Member

    Feb 16, 2010
    3
    0
    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: Feb 17, 2010
  5. subarna

    New Member

    Feb 16, 2010
    3
    0
    [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();

     
Loading...