Creative Embedded Systems Module 2 (and potentially forward) Project: Uses the TFT_eSPI library, Arduino Breadboard, Joystick, Potentiometer, Push Button, and Processing IDE to play a roguelike Polygon game.
You can take an in depth look at my process making this program in this blog post.
- Features and Tools
- How to Build the Project
- Circuit Design
- Concept Design
- Enclosure Design
- Contributors
- Arduino IDE
- Processing IDE
- Lilygo TTGO ESP32
- Arduino Breadboard
- Joystick
- Potentiometer
- Tactile Push Button Switch
- Wire Kit
- Jumper Wires
- USB-C cable
-
Clone the repository:
git clone https://github.com/asder8215/Polyscend.git
-
From the src folder, import or move the
input_setup.inofile insrc/arduino_setupfolder into Arduino Folder- If Arduino IDE is not installed, look at this Arduino Support Page on how to install the Arduino IDE.
-
Follow these installation steps to correctly set up the libraries needed to write and run code for TTGO ESP32
-
Once your Arduino IDE is set up, you can connect your ESP32 to your laptop or computer via USB-C and click on the
Uploadbutton on the top left of the Arduino IDE. This will make the code compile and store onto the ESP32. -
Set up the circuitry with the ESP32, joystick, potentiometer, push button on the breadboard following the Fritzing diagram below (Note: any modifications done to the circuitry on the breadboard should be done while the ESP32 is unplugged from your laptop).
-
After your circuitry is fully set up, you can plug your ESP32 to your laptop and see on Serial Monitor (make sure the baud rate is set at 9600) if output is printing on there based on your joystick's position, potentiometer value, and button state (whether it's pressed or not).
-
To further check if it works, you can open up Processing IDE (ESP32 must remain connected to your laptop via USB-C) and open the file
input_test.pdeinsrc/input_testfolder. You can then run the program on Processing and see if Processing is able to receive your input. The program should show a circle on screen, which can be moved by the joystick, turn white when the push button is clicked, and its radius should vary based on the clockwise position of the potentiometer knob. -
If all of that works perfectly, you can open and run the
polyscend.pdefile (make sureEntity.pdeanddata/pixel_operatorfolder is in the same directory as it) insrc/polyscendfolder. See how the demo above on how it works! -
Optional: You can 3D print cases for your joystick, potentiometer, and push button to have a more comfortable time playing the game with it.
- Note: You can directly insert the potentiometer and push button to the arduino breadboard or solder the ends of the potentiometer/push button to the breadboard. You can solder for the joystick's ends or use header wires to connect it to the board as well.
These contain images of Polyscend concept design. Some of these images may not be implemented or changed on how it works/shown in the game as it is currently.
- Title Screen

- Battle System

- Reward Screen (Not implemented)

- Ending Screens (Win screen not implemented)

These contains images of the enclosure made for the joystick, potentiometer, and push button.
-
Note: You can find the stl files used to 3D this enclosure for the joystick, potentiometer, and push button in
enclosure_designfolder. A lot of tapes was used to keep the individual cases for joystick, button, and potentiometer together.
- Mahdi Ali-Raihan




