This wireless signal tester turns an ESP32 into a multi-game reaction trainer with visual feedback on an OLED display and audio cues from a buzzer module. Players use a joystick to navigate five different games—Dodge, Paddle, Catch, Reaction, and Target—each testing different aspects of hand-eye coordination and response time.
The guide includes a complete wiring diagram connecting the SSD1306 OLED, PS2 joystick, and buzzer module to the ESP32, a full parts list, and ready-to-deploy firmware. Assembly takes minutes with just a USB connection, and gameplay begins immediately with no additional setup required.
Wiring diagram
Gather all the parts
Assemble it in 2 steps
1. Wire the arcade with USB unplugged
Connect all grounds to GND. Connect OLED VCC, joystick power (even if labeled +5V), and buzzer VCC to 3V3. OLED SDA goes to GPIO21 and SCL to GPIO22. Joystick VRX goes to GPIO34, VRY to GPIO35, and SW to GPIO32. Buzzer I/O goes to GPIO25.
- Use a 3.3 V compatible four-pin I2C OLED and three-pin buzzer. Never power the joystick from 5 V in this circuit.
2. Deploy and play
Leave the joystick centered when powering on. Move up or down to choose a game, click to start or play, and hold for one second to return to the menu.
Review all connections
1. Connections between "buzz" and "ESP32"
2. Connections between "oled" and "ESP32"
3. Connections between "stick" and "ESP32"
Deploy the firmware
#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_SSD1306.h>
#include <cstring>
Adafruit_SSD1306 d(128,64,&Wire,-1);
uint8_t previous[1024];
const char* names[]={"Dodge","Paddle","Catch","Reaction","Target"};
int game=-1, pick=0, score, px,py,bx,by,vx,vy,cx,cy;
uint32_t tick, waitUntil,result,down,scan, beepEnd;
bool ended, consumed,ready,raw,stable;
uint32_t changed;
void beep(){ digitalWrite(25,HIGH); tone(25,1800); beepEnd=millis()+100; }
void spawn(){bx=random(4,124);by=13;}
void start(){game=pick; ended=false;score=0;px=64;py=42;bx=64;by=25;vx=2;vy=2;
if(game==0||game==2)spawn();
if(game==4){bx=random(8,120);by=random(18,57);}
waitUntil=millis()+random(1500,4500);tick=millis();beep();}
void setup(){pinMode(32,INPUT_PULLUP);pinMode(25,OUTPUT);digitalWrite(25,LOW);
Wire.begin(21,22);ready=d.begin(SSD1306_SWITCHCAPVCC,0x3C,false,false);
if(!ready)return;
d.clearDisplay();d.display();d.setTextColor(SSD1306_WHITE);
for(int i=0;i<16;i++){cx+=analogRead(34);cy+=analogRead(35);delay(3);}cx/=16;cy/=16;
randomSeed(micros());}
void loop(){if(!ready){delay(100);return;}
uint32_t now=millis();
if(beepEnd && (int32_t)(now-beepEnd)>=0){noTone(25);pinMode(25,OUTPUT);digitalWrite(25,LOW);beepEnd=0;}
bool r=!digitalRead(32),click=false;
if(r!=raw){raw=r;changed=now;}
if(raw!=stable && now-changed>=25){stable=raw;if(stable){down=now;consumed=false;}else click=!consumed;}
if(stable&&!consumed&&now-down>=1000){game=-1;consumed=true;}
int x=analogRead(34)-cx,y=analogRead(35)-cy;
int dx=(x>500)-(x<-500),dy=(y>500)-(y<-500);
if(game<0){if(dy&&now-scan>=220){pick=(pick+dy+5)%5;scan=now;}if(click){start();click=false;}}
else if(ended){if(click)start();}
else if(game==3){if(click){ended=true;result=(int32_t)(down-waitUntil)>=0?down-waitUntil:UINT32_MAX;beep();}}
else {
if(now-tick>=35){tick=now;px=constrain(px+dx*3,6,121);
if(game==4)py=constrain(py+dy*3,15,60);
if(game==0||game==2){by+=2+min(score/4,4);
if(by>=53){bool hit=abs(bx-px)<=10;
if(hit==(game==2)){score++;spawn();beep();}else{ended=true;beep();}}}
if(game==1){bx+=vx;by+=vy;if(bx<=2||bx>=125)vx=-vx;if(by<=13)vy=2;
if(by>=54&&vy>0&&abs(bx-px)<=13){vy=-2;score++;beep();}if(by>=63){ended=true;beep();}}}
if(game==4&&click){if(abs(px-bx)<=6&&abs(py-by)<=6){score++;bx=random(8,120);by=random(18,57);beep();}else{ended=true;beep();}}
}
d.clearDisplay();d.setCursor(0,0);
if(game<0){d.println("JOYSTICK ARCADE");for(int i=0;i<5;i++){d.print(i==pick?"> ":" ");d.println(names[i]);}}
else {d.print(names[game]);if(game!=3){d.print(" Score: ");d.print(score);}d.drawFastHLine(0,10,128,1);d.setCursor(0,20);
if(ended){if(game==3){if(result==UINT32_MAX)d.println("Too soon!");else{d.print(result);d.println(" ms");}}else d.println("Game over");d.println("Click to retry");d.println("Hold for menu");}
else if(game==3)d.println((int32_t)(now-waitUntil)>=0?"CLICK NOW!":"Wait for the cue...");
else {d.fillCircle(bx,by,game==4?4:2,1);if(game==4){d.drawFastHLine(px-5,py,11,1);d.drawFastVLine(px,py-5,11,1);}else d.fillRect(px-10,56,21,3,1);}}
if(memcmp(previous,d.getBuffer(),sizeof previous)){memcpy(previous,d.getBuffer(),sizeof previous);d.display();}
delay(10);
}Remix this project
Make it yours in one click
Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.




