lily jam is an interactive hardware project that uses ESP-NOW communication between two ESP32 boards to play a cooperative rhythm game. During the game, two players attempt to earn the highest combined team score by pressing the buttons on their ESP32s as notes reach the hit line in their respective lanes. Depending on their timing accuracy, players earn 100 points for a Perfect hit, 50 for a Good hit, and 0 for a Miss. The game is inspired by Piano Tiles and various K-pop rhythm games -- the current version features "What is Love?" by TWICE as the backing track! The visual interface is displayed using Processing.

- Player 0: left two lanes (lily)
- Player 1: right two lanes (jam)
- Left button (GPIO0): hits notes in the player's left lane
- Right button (GPIO35): hits notes in the player's right lane
- Enter (keyboard): starts game from start menu
- R (keyboard): restarts game from end menu
Software:
- Arduino 2.3.10 (may support lower)
- TTGO T-Display USB-to-serial driver (CHXXX)
- Processing 4
- Sound library
- Serial library
Hardware:
- Two LILYGO ESP32 TTGO T-Display boards
- Two USB cables for power and communication
git clonethis repo and openlily-jam.inoin Arduino.- Set
TEAM_IDto the same value on both boards andPLAYER_IDto0for the first player. Compile and uploadlily-jam.inoto the first ESP32. - Change
PLAYER_IDto1for the second player, keepingTEAM_IDunchanged. Compile and upload the modified sketch to the second ESP32. - Connect one ESP32 to the computer running Processing via USB. Keep the second ESP32 powered on (e.g., through another computer). The boards communicate wirelessly via ESP-NOW, and the first board forwards button inputs to Processing over Serial.
- Open
./lily_jam/lily_jam.pdein Processing. This is the primary file for our program, with Note.pde and Entry.pde defining the Note and Entry classes. - Check the available serial ports printed by
Serial.list()and update the port index inlily_jam.pdeto match the connected ESP32. Make sure Arduino's Serial Monitor is closed. - Run the Processing sketch. The game display should pop up in a separate window. Enter both players' names and press Enter to begin!
- The leaderboard stores each team's best performance, ranked by accuracy percentage, and persists between games.