Need Guidance with Arcade Button Presses & Arduino

Hi all,

I don't have any experience with Arduino besides uploading some copy+paste code once. I need guidance as to what is required to make the following work. I don't think it's complex for anyone with some Arduino experience and I simply need to have the right verbiage to communicate it to a partner who will do it.

I have a video game console that resets to the main game menu when buttons A, B and C are pushed down for about a second. I want to incorporate Arduino so that if no one is pressing any of those 3 buttons (the arcade is in an idle state) for 3 minutes, A&B&C corresponding button wires are activated/"pushed in the backend" as if physically pushed to reset to menu automatically. This will require some kind of internal clock on the Arduino to listen for button presses to reset the 3 minute timer when there's an input of A, B or C.

Please find attached a basic circuit board I'm using for my project in order for the video game console to register arcade button presses. Yellow font is ground and Red font are leads to joystick buttons. I'll need this circuit board to shake hands with the Arduino.
Imgur

There are actually 11 buttons total but the idea should be the same.

I hope this isn't too much of an ask. I just need Arduino to listen for button presses and if 3 minutes pass without one then to trigger a reset.

Thanks!

The following example uses arrays for the switches and the blink without delay method for timing. See the beginner guide to millis() for more information on using millis(). As it is, it will fire a 1ms reset pulse every 20 seconds* if no buttons are pressed (assuming Normally Open momentary switches wired to ground when pressed). Any button pressed resets the timer.

  • I don't want to wait 3 minutes.
// values for the 3 minut timer
unsigned long timer = 0;
unsigned long interval = 20000;  //1000L*60L*3L; time short for test

const byte resetOutputPin = 13; // the onboard LED
const byte numPins = 11;
// array of pin nmbers connected to switches
const byte pins[numPins] = {2,3,4,5,6,7,8,9,10,11,12};



void setup()
{
  Serial.begin(115200);
  
  for(int n = 0; n < numPins; n++)
  {
    pinMode(pins[n], INPUT_PULLUP);
  }
  
  pinMode(resetOutputPin, OUTPUT);
  digitalWrite(resetOutputPin, LOW);
  timer = millis();
}

void loop()
{
  static byte time = 0; // prints seconds for testing
  if(millis() - timer >= interval)  // has the interval elapsed
  {
    timer = millis(); 
    digitalWrite(resetOutputPin, HIGH);
    delayMicroseconds(1000); // send 1 millisecond HIGH pulse
    digitalWrite(resetOutputPin, LOW);
    Serial.println("\nReset output");    
  }
  // check the switches
  for(int n = 0; n < numPins; n++)
  {
    if(digitalRead(pins[n]) == LOW)
    {
      timer = millis(); // reset the timer
      time = 0;  // reset seconds for testing
    }
  }
  
  // print the seconds every secnd for testing
  static unsigned long printTimer = 0;
  unsigned long printInterval = 1000;
  if(millis() - printTimer >= printInterval)
  {
    printTimer = millis();
    Serial.print(time++);
  }
}

This is excellent and more than I would've ever expected. I'll relay this info to my partner and let you know if we need any more clarity.

Thanks so much.