Skip to content

ki-manufaktur/neurodots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NEURODOTS

This project is inspired by the 3D printed 4x4 Colour Dot Puzzle by Sebastian Coddington and featured in Hackaday: Color Dot Puzzle Will Wrinkle Your Brain.

Neurodots is an electronic version of the color dot puzzle, utilizing a WS2812 RGB maze. The dots are shifted horizontally or vertically using switches on the sides of the maze to guide the dots into the solution configuration.

In addition to the core gameplay of solving the puzzle, the project includes a feature that displays solution hints, generated by a neural network running on the RP2040 using TensorFlow Lite for Microcontrollers (TFLM). This demonstrates an intriguing application of a small neural network, as the theoretical number of possible game states is approximately 1.19e+16.

Storing a recommended move for all these states would be far beyond the storage capacity of an embedded device, even with clever compression techniques. Moreover, even if storage wasn’t an issue, determining a near-optimal move to solve the puzzle is a non-trivial task. This challenge also applies to heuristic algorithms running on the device.

Thus, the training objective of the neural network was to find a policy that solves the puzzle using the minimum number of moves. By quantizing and deploying this model in the TFLM environment, solutions are generated in real-time, with a response time of approximately 1.4 seconds from state change to recommendation.

Usage

neurodots.mp4
  1. Starting the Game: Press the push button to start a new game. The LED matrix will display a shuffled maze according to the configured difficulty level.
  2. Interacting with the Game: Use the slide switches to toggle the paths of the maze.
  3. Hints: If you need help, press the push button to see the next move, as suggested by the device’s AI, on the LED matrix.
  4. Finishing the Game: The game will automatically detect when the puzzle has been solved and will display a completion animation on the LED matrix.

Installation

  1. Clone the repository and navigate to the project folder:

    git clone https://github.com/ki-manufaktur/neurodots.git
    cd neurodots
  2. Build the project using CMake. Ensure you have exported the PICO_SDK_PATH environment variable before proceeding:

    export PICO_SDK_PATH=/path/to/pico-sdk
    mkdir build
    cd build
    cmake ..
    make
  3. Flash the compiled binary to your Raspberry Pi Pico:

    • Bridge JP1 to enable flashing
    • Copy the neurodots.uf2 file to the RP2040 flash drive to complete the installation.

Configuration

Brightness and Level Settings: Hold down the push button while turning on the device to adjust the brightness and difficulty level using the slide switches. The settings will be saved to flash memory for future sessions.

Difficulty Level

The difficulty level can be set using the horizontally aligned switch row, as shown below:

+-------------------------------+
| [ X ]  [ S2 ]  [ S1 ]  [ S0 ] |
|          ↑1      ↓0      ↑1   |
+-------------------------------+

In this example, the switch configuration (with the rightmost switch being the least significant bit, LSB) represents a
Difficulty Level = (1 × 2^2) + (0 × 2^1) + (1 × 2^0) = 5

Brightness

config

Similar to the difficulty level, the brightness of the LEDs can be set using the vertically aligned switch column, as shown below:

+-----+
| S3  |  (No Function)
+-----+
| S2  |  ↑1
+-----+
| S1  |  ↑1
+-----+
| S0  |  ↓0  (LSB)
+-----+

Where in this configuration the brightness level is 6.

Contributing

We welcome contributions! Feel free to open issues for bug reports, feature requests, or any suggestions to improve the game. You can also submit pull requests to add new features or enhance existing functionality. Please ensure to follow any contribution guidelines provided.

License

This project is dual-licensed:

  • The software is licensed under the GNU General Public License v3.0 (GPLv3).
  • The PCB designs and schematics are licensed under the Creative Commons Attribution-NonCommercial-ShareAlike (CC BY-NC-SA) license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages