In my initial version of ‘Many Games of Pong‘, the act of switching between controllers was so frustrating that it deterred players from doing so. This design used a 6-pin usb-to-serial adapter, which the user had to plug in “just right” before they even could play. The diagram below illustrates this initial schematic and systems.
This point of friction detracted from the key idea of players testing different controllers and de-standardizing the tools used to play games. As such, I’ve continued to develop the circuit with a focus on selecting and switching-between controllers.
The new circuit, illustrated above, uses an ESP8266 Wi-Fi chip microcontroller to eliminate wiring for sending data to the between the game and controllers. Additionally, a toggle switch, coupled with an LED, sets the state of whether or not a controller is actually connected to the game (as opposed to the hardwired connection). The server-side code keeps track of which controllers are connected and which player they’re associated with.
There’s a delay between pressing a button and seeing the effect on screen that’s still lingering, as well as the question of power. The video shows a wired connection from each controller to the computer, but that’s simply for power – not data transfer.
Code Updates
This iteration also focused on simplifying the code. My previous code for moving the paddle based on each controller was verbose and repetative. I’ve since rewritten the code to use switch cases which really simplified things.
Next Steps
The next step in the project is to create custom boards rather than use the Huzzah. Adafruit’s ESP8266 breakout board is a good reference for starting the schematic. Since some of the controllers use digital sensors (simple push buttons) while others rely on analog (photocell), the boards will be slightly different for each. Additionally, I’d like to put more time into the tangibility and tactile qualities of the sensors I use and have been hunting down various products.
Future References
- Programming jig tutorials: this one by Alex Glow helped me understand the how to use the GPIO0 and Reset pins for programming
- Getting Started with the ESP8266 ES12
- Some helpful programming FAQs
- Examples: RGB strip, a lithium charging breakout, a smart mailbox
- This breakout board is more than what I’m looking for builds in usb-to-serial communication
- Lots of tips on this forum (ie, use a 100uF capacitor near 3.3V pin but ceramic or electrolytic?; include a 500 mA regulator
- ESP8266 Forum
- How to program the ESP with Arduino
- Purchase: Adafruit (short shipping but expensive), or AliExpress (but long shipping time), cheap from Electrodragon (10-15 days), lots on Amazon