Skip to content

A maze generator and solver that displays it in a (hopefully) pretty way through a LED matrix.

Notifications You must be signed in to change notification settings

PedroAraoz/ledMaze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Led Maze

A maze generator and solver that displays it in a (hopefully) pretty way through a LED matrix.
This Proof of Concept of the idea is based on Numberphile's video "The Lightning Algorithm".

leds

Table of contents

  1. About
  2. Instructions
    1. Hardware Components
    2. Schematic
    3. 3D Printed Files
    4. Steps
  3. Performance
  4. Contribution
  5. Sponsors

About

The maze generation currently uses Depth-First Search and Breath-First Search to solve it.
Each of the steps in the BFS are used to do the animation. Then it uses blaz-r/pi_pico_neopixel library to control the pixels and try to make some cool patterns.

Instructions

Hardware Components

  • Raspberry Pi Pico
  • 8x8 WS2812B LED matrix
  • 5V power supply

Schematic

schematic

3D Printed Files

  • ...

Steps

  1. Clone the repo
  2. Connect the Raspberry Pi Pico to your computer
  3. Upload Cell.py, Generation.py, Maze.py, Printer.py, Solver.py to the pico with those names. (I recommend using something like Thonny)
  4. Upload blaz-r/pi_pico_neopixel neopixel.py
  5. Edit variables in main.py if necessary for your specific configuration. (If you are copying everything else in these instructions it shouldn't be necessary)
  6. Upload main.py.
  7. Connect the pins according to the schematic.

Performance

As stated before, I did not focus on performance as this was more of a Proof of Concept of the idea and a way to try micropython and the raspberry pi pico. Nevertheless, this is the current performance:

Grid size: 8x8
Sample size: 500
Minimum Path Length: 40

delay (ms)
max 18258
min 92
average 2985.168

If the maze generates in less time than the previous animation takes to display it will continue to seamlessly play one animation after the other. This is because the code utilizes the Pico's multithreading option, so while one core is doing the animations,the other is generating the next maze.

Animations usually take around 10 seconds, so a max case of 18 is not ideal. However, only 17/500 took longer than 10 seconds, so I find that acceptable. If you never want to have a delay larger than 10s you should probably decrease the minimum path length a bit.

Contribution

Any contribution to the project is greatly appreciated, just open a PR.

Sponsors


seib0

About

A maze generator and solver that displays it in a (hopefully) pretty way through a LED matrix.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages