Introduction: PUZZLE - Arduino Logic Game
Step 1: Initial Version
The TFT-shield is convenient in that it has a slot for connecting a micro SD card and an integrated hardware Jpeg decoder. This feature allows you to quickly and easily make your own photo frame for viewing photos (of course, based on a demo). That is what I first did.
But then I got bored with just looking at the photos and then the idea came to my mind: would I try to make a logical game? Several evenings were spent writing a sketch for Arduino Uno. And the initial version was ready.
A photo is loaded from the microSD card, the image on the screen is divided into 4x3 cells, the lower right cell disappears and all cells begin to randomly move. By pressing the left button below the screen you can load the next photo. By pressing the middle button you can start the game - to collect puzzles. Moving puzzles by pressing on the touch screen TFT-Shield. As an example, I recorded pictures from instructables.com on a micro SD card. You can record any of your photos on the micro SD card.
Step 2: Adding Functionality
Collecting puzzles 4x3 is interesting, but easy and fast enough. I wanted to complicate the game, for example, to increase the partition from 4x3 to 8x6.
I added the ability to set the number of columns and rows in the sketch (recommended: 4x3, 4x6, 8x3, 8x6). Playing has become much harder and longer. And it has become much more difficult to navigate the puzzles.
I decided to add a hint - when I clicked on the fourth button (from left to right), cell numbers appear on the screen. When you click on the second button (from left to right) tips on the screen disappear. When you click on the first button, you can change the color of the tooltip (depending on the photo) to make the tooltip as readable as possible.
Step 3: Demonstration
As a result of my work, I got a game, for the demonstration of which I made the following video.
At the end of the instructions I attach the sketch TFT_shield_Puzzle. To compile the sketch you need to install the library YATFT.
I hope you enjoyed my instructions.
Thank you for watching.
Participated in the