This is a demo for the RasQberry Two Platform. It is an implementation of the Lights Out puzzle game that is solved using a quantum algorithm and then displays every step of the solution process on the RasQberry Two's LED panel. The LED panel is required for this script to run, although you can also have the solution steps printed to the console by adding the --console argument.
The git repo for the RasQberry Two Project can be found here.
Thank you to the IBM Quantum Challenge 2020 for providing most of the code for the quantum algorithm. More info and tutorials can be found here.
| Argument | Default | Description |
|---|---|---|
| -h, --help | None | Displays the help message and then exits. |
| -c, --console | False | Displays the lights out grid in the console. (bool) |
| --delay | 1.0 | Sets the delay (in seconds) between iteration steps for the LED array and console. (float) |
| -b, --brightness | 1.0 | Sets the brightness of the LEDs. Accepts ranges between 0.0 and 1.0. (float) |
Install all the necessary dependencies using pip:
pip install -r requirements.txtRun the script using:
python3 lights_out.pyTo run the script with console printing of every step, use:
python3 lights_out.py --consoleAdditionally, to turn off all of the LEDs, you can run this script:
python3 turn_off_LEDs.py! Note: To run this script on a Raspberry Pi 5, you need to have SPI set up and use the proper wiring configuration. Instructions for wiring and setting up SPI can be found here.
