Mission PhantomGame | CGD X IEEE Concordia

Intro

Hello! This is my first personal blog. So, let's get started! For the CGD X IEEE game jam, I made a custom gamepad controller for our (really cool) game https://conugrinder.itch.io/shockcomplex with Jack, Parsa, Nameer, Liam, and Elizabeth. Liam and Parsa helped me on the controller and I couldn't have done it without them. So, I'd like to express my sincere gratitude to Liam and Parsa for their assistance and support throughout this project.

The gamepad makes use of an ESP32 using the https://github.com/lemmingDev/ESP32-BLE-Gamepad and https://github.com/h2zero/NimBLE-Arduino libraries. Using this guide as a reference, Mission PhantomGame Demo, the intention was to write a code in Arduino IDE that includes the following items on our controller: six buttons, two joysticks, and two motors for vibration. My objectives for this game jam were to:

The setup

The first step I did was to set up the proper Arduino environment to code the ESP32. All I had to do was to install the Espressif ESP32 library, and choose the right board (ESP32 Dev Module) and the right port communication. In addition, I had to install a driver than enables serial communication between the IDE and the board. The next steps were to install the proper libraries (mentioned in the Intro) to make the gamepad work. Overall, the setup process was relatively easy and was completed smoothly.

The components

image.png

The components are: an ESP32, two joysticks, wires, a breadboard, two motors (one carrying more weight than the other), four buttons and four caps. Joysticks are potentiometers, where Vrx and Vry are outputs of the joysticks which are then fed into the ESP32. The ESP32 can read the values by converting the analog signals into digital ones (x and y).

The next steps were to assemble the pieces together, making sure that the right terminals are connected. The inputs are joysticks and the buttons. The outputs are the motors. We have to make sure the right pins of the components are connected to the ESP32. For example, certain pins of the device possess analog-to-digital converter (ADC) and others send Pulse-width modulation (PWM) signals for the motors.

The prototype:

image.png