Need help for a button game like Twister but with fingers

Hi, I am new and am making a game that is like Twister but with fingers. I name my game as "Finger Challenge". I looked through many links to make it and still have some problems. For your information, I am using Arduino UNO.

Below is the flow:
A player presses the start button.
The Serial Monitor show a line asking "How many players?" Pressing button1= 1 player and pressing button2 = 2 players.
The first player presses the next button.
The Serial Monitor shows random 3 numbers from 1 to 10, and three random fingers he/she should use.
If the player press and hold his/her fingers on the 3 locations (the locations are buttons) correctly for 3 seconds, the Serial Monitor will show "Sucess" and the buzzer will play happy music.
If the player press and hold his/her fingers on the wrong locations, the Serial Monitor will show "Fail" and the buzzer will play sad music.
The player can start over, or the next player can press the next button.
During the next round, the two servo motors with rotate slightly.

:frowning: The problems: There are some lines that don't show up in the Serial Monitor, such as "Press START", the second and third random numbers, etc.
Also, some lines just keep on showing up in the Serial Monitor although I didn't press any button. The three random fingers cannot be generated.
My output in the Serial Monitor is here: (Thanks to Paul for the reminder.)

1
832
845
 Hi player1 
 Let's start! 
 Press NEXT to begin.
Number 0 is: 3
Press with these fingers: [finger1], [finger2], [finger3] 
11
861
810
 Hi player1 
 Let's start! 
 Press NEXT to begin.
Number 0 is: 9
Press with these fingers: [finger1], [finger2], [finger3] 
11
948
901
 Hi player1 
 Let's start! 
 Press NEXT to begin.
Number 0 is: 8
Press with these fingers: [finger1], [finger2], [finger3] 
12Fail! T_T Press NEXT

My code is very long that it exceeds the character limit here, so I will post it in a reply(#2) in this post.
Lastly, I attached a photo of the setup (setup1.png).
I hope you can kindly tell me how to solve the problems. Your kind help will be appreciated. Thank you very much.

Hi, welcome to the forum.

Thanks for posting the image of your "plate".

Please don't post images of code or serial monitor output. Post the actual text of the code or output using code tags. Please don't post zip files, no-one will want to open them in case they contain something dangerous, and many forum members use phones and tablets to read the forum much of the time and won't be able to view the zip file's contents.

Please take a moment to read the forum guide in the sticky post at the top of the forum, then modify your post above.

My code:

int button_num = 10;
int buttonpin[] = { 1, 2, 3, 4, 5, 6, 7 , 8 , 9 , 10 };

int startpin = A0;
int nextpin = A1;

int startbuttonstate = 0;
int nextbuttonstate = 0;
int button1state = 0;
int button2state = 0;
int button3state = 0;
int button4state = 0;
int button5state = 0;
int button6state = 0;
int button7state = 0;
int button8state = 0;
int button9state = 0;
int button10state = 0;

//2 servo to rotate 2 plates
#include <Servo.h>
const int servoPin1 = 11;  //outer circle
Servo Servo1;
const int servoPin2 = 12;   //inner circle
Servo Servo2;

int buzzer = 13;
#include "pitches.h"
//success 
int melody1[] = {
  NOTE_C3, NOTE_E3, NOTE_G3, NOTE_C4
};
int noteDurations1[] = {
  4, 4, 4, 4
};
//fail 
int melody2[] = {
  NOTE_D2, NOTE_D2, NOTE_D2
};
int noteDurations2[] = {
  4, 4, 4
};

//pick 3 random fingers
#include <EEPROM.h>
template <class T> int EEPROM_writeAnything(int ee, const T& value)
{
  const byte* p = (const byte*)(const void*)&value;
  int i;
  for (i = 0; i < sizeof(value); i++)
    EEPROM.write(ee++, *p++);
  return i;
}
template <class T> int EEPROM_readAnything(int ee, T& value)
{
  byte* p = (byte*)(void*)&value;
  int i;
  for (i = 0; i < sizeof(value); i++)
    *p++ = EEPROM.read(ee++);
  return i;
}
void BetterRandomSeed( void )
{
  unsigned long __seed;

  EEPROM_readAnything( 0, __seed );

  srandom( __seed );
}
long BetterRandom( void )
{
  long __seed;

  __seed = random();

  EEPROM_writeAnything( 0, __seed );

  return ( __seed );
}

long BetterRandom( long howbig )
{
  if ( howbig == 0 )
  {
    return 0;
  }
  return ( BetterRandom() % howbig );
}

long BetterRandom( long howsmall, long howbig )
{
  if ( howsmall >= howbig )
  {
    return howsmall;
  }
  long diff = howbig - howsmall;

  return ( BetterRandom(diff) + howsmall );
}

char *fingers[] = {"R thumb", "R index", "R middle", "R ring", "R pinky",
                   "L thumb", "L index", "L middle", "L ring", "L pinky"
                  };
long finger1;
long finger2;
long finger3;

int val = 0;

//pick 3 random numbers
int randomnum[10];
int amountofnum = 3;
const int minrandomnum = 1;
const int maxrandomnum = 10;
boolean duplicatefound;
int duplicatetotal;
const boolean debug = false;

//numbers for second round (deal with this later)
int R1, R2, R3;

//compare if buttons input match the generated numbers
int pwcount;
byte combination[] = "counter1 counter1 counter1";
//above maybe wrong
byte userInput[3];

void setup() {
  Serial.begin(9600);

  for (int i = 1; i <= button_num; i++) {
    pinMode(buttonpin[i], INPUT);
  }

  pinMode (startpin, INPUT);
  pinMode (nextpin, INPUT);
  //2 servo motors
  Servo1.attach(servoPin1);
  Servo2.attach(servoPin2);

  pinMode (buzzer, OUTPUT);
  noTone(buzzer);

  randomSeed(analogRead(0));

  Reset();
}
void Reset() {
  int startbuttonstate = LOW;
  int nextbuttonstate = LOW;
  int button1state = LOW;
  int button2state = LOW;
  int button3state = LOW;
  int button4state = LOW;
  int button5state = LOW;
  int button6state = LOW;
  int button7state = LOW;
  int button8state = LOW;
  int button9state = LOW;
  int button10state = LOW;
}

void loop(){
  int buttonstate = 0;
  //read all buttonstate 
  for (int i = 1; i <= button_num; i++) {
    buttonstate = digitalRead(buttonpin[i]);
    Serial.println(buttonstate);  //not display, only for checking
    break;
  }

  startbuttonstate = analogRead (startpin);
  nextbuttonstate = analogRead (nextpin);
  Serial.println(startbuttonstate);  //just for checking
  Serial.println(nextbuttonstate);

  //start game
  if (startbuttonstate == LOW && nextbuttonstate == LOW) {
    noTone(buzzer);
    Serial.println("Press START");
    delay(3000);
  }
//ask how many players
  if (startbuttonstate == HIGH) {
    Serial.println ("How many player?");
    delay(500);
    Serial. println ("Button 1 = 1; Button 2 = 2");
    delay(4000);
  }

  int button1state = digitalRead (buttonpin[1]);
  int button2state = digitalRead (buttonpin[2]);

  if (button1state == HIGH) {
    //greet
    Serial.println(" Hi player1 ");
    delay(2000);
    Serial.println(" Let's start! ");
    delay(2000);
    Serial.println(" Press NEXT to begin.");
  }
//assign 3 random numbers
  while (analogRead(nextbuttonstate) == LOW);
  if (debug == true) {
    Serial.println ("Generating");
  }

  int duplicatetotal = 0;
  for (int counter1 = 0; counter1 < amountofnum; counter1++) {
    duplicatefound = true;

    while (duplicatefound == true) {
      randomnum[counter1] = random(minrandomnum, maxrandomnum);

      duplicatefound = false;

      for (int counter2 = 0; counter2 < counter1; counter2++) {
        if (randomnum[counter1] == randomnum[counter2]) {
          duplicatefound = true;
          duplicatetotal++;
        }
      }
    }
  }
//Finishing generating numbers
  for (int counter1 = 0; counter1 < amountofnum; counter1++) {
    Serial.print("Number ");
    Serial.print(counter1);
    Serial.print(" is: ");
    Serial.println(randomnum[counter1]);
    delay (500);
    break;
  }

//the 3 fingers the player should use
  finger1 = BetterRandom(sizeof(fingers) / sizeof(char*));
  do {
    finger2 = BetterRandom(sizeof(fingers) / sizeof(char*));
  }
  while ( finger2 == finger1 );
  do {
    finger3 = BetterRandom(sizeof(fingers) / sizeof(char*));
  }
  while ( finger3 == finger2 );
  Serial.println("Press with these fingers: [finger1], [finger2], [finger3] ");
  delay(100);

//Check if buttons input match the generated numbers
  if (button1state == HIGH) {
    //problem: will pressing 1 cause two things to happen?
    userInput[pwcount] = '1';
    pwcount++;
    delay(300);
    Serial.print('1');
  }
  if (button2state == HIGH) {
    //problem same as above if have 2 players?
    userInput[pwcount] = '2';
    pwcount++;
    delay(300);
    Serial.print('2');
  }
  if (button3state == HIGH) {
    userInput[pwcount] = '3';
    pwcount++;
    delay(300);
    Serial.print('3');
  }
  if (button4state == HIGH) {
    userInput[pwcount] = '4';
    pwcount++;
    delay(300);
    Serial.print('4');
  }
  if (button5state == HIGH) {
    userInput[pwcount] = '5';
    pwcount++;
    delay(300);
    Serial.print('5');
  }
  if (button6state == HIGH) {
    userInput[pwcount] = '6';
    pwcount++;
    delay(300);
    Serial.print('6');
  }
  if (button7state == HIGH) {
    userInput[pwcount] = '7';
    pwcount++;
    delay(300);
    Serial.print('7');
  }
  if (button8state == HIGH) {
    userInput[pwcount] = '8';
    pwcount++;
    delay(300);
    Serial.print('8');
  }
  if (button9state == HIGH) {
    userInput[pwcount] = '9';
    pwcount++;
    delay(300);
    Serial.print('9');
  }
  if (button10state == HIGH) {
    //Why 10 does not appear blue?
    userInput[pwcount] = '10';
    pwcount++;
    delay(300);
    Serial.print('10');
  }

  //Match
  for (byte n = 0; n <= 3; n++) {
    if (userInput[pwcount] == combination[n] && pwcount >= 3) {
      Serial.println("Success! ^_^ Press NEXT");
      pwcount = 0;
      delay(1000);
      for (int thisNote = 0; thisNote < 4; thisNote++) {

        int noteDuration1 = 1000 / noteDurations1[thisNote];
        tone(13, melody1[thisNote], noteDuration1);

        int pauseBetweenNotes = noteDuration1 * 1.30;
        delay(pauseBetweenNotes);
        noTone(13);
        break;
      }
    //Not match
    } else {
      if (userInput[n] != combination[n] && pwcount >= 3) {
        Serial.println("Fail! T_T Press NEXT");
        pwcount = 0;
        n = 0;
        delay(1000);

        for (int thisNote = 0; thisNote < 3; thisNote++) {

          int noteDuration2 = 1000 / noteDurations2[thisNote];
          tone(13, melody2[thisNote], noteDuration2);

          int pauseBetweenNotes = noteDuration2 * 1.30;
          delay(pauseBetweenNotes);
          noTone(13);
          break;
        }
      }
    }
  }
// play one more round <round 2>.
//if (nextbuttonstate = HIGH){
//Serial.println ("Round 2");
//Servo1.write(90);
//delay(1000);
// assign 3 random numbers.
//  Serial.println("Number:");
//  Serial.println(R1);
//  Serial.print(R2);
//  Serial.print(R3);
//  delay(9000);  //need to delay or it will wait?

//if (button2state == HIGH){
//Serial.println("Hi player1 and player2 ");
//}
}   //void loop

Thanks for those changes. +1 karma

I notice you are not using pin mode(x, INPUT_PULLUP). How are your buttons wired?

PaulRB:
I notice you are not using pin mode(x, INPUT_PULLUP). How are your buttons wired?

Oh, I thought I was already using pin mode in lines 131 to 136. So, for these lines, should I change all “INPUT” into “INPUT_PULLUP”?

 for (int i = 1; i <= button_num; i++) {
    pinMode(buttonpin[i], INPUT);
  }

  pinMode (startpin, INPUT);
  pinMode (nextpin, INPUT);

Below is an image of how my buttons are wired:

Right now, the input pins connected to the buttons are "floating". They are connected to neither 5V or ground, and so digitalRead() could give HIGH or LOW at random. Even when a button is pressed, it is still not connected to 5V or ground. It is connected to the rail at the bottom of the breadboard, but that rail is not connected to 5V or ground, so it too is floating. To make this work, you need to use INPUT_PULLUP so that when a button is not pressed, the pin is weakly "pulled up" to 5V. But then, when a button is pressed, it will still be connected only to 5V because that breadboard rail is not connected. Connect that rail to ground, so that when a button is pressed, it is pulled strongly down to ground, overcoming the weak pull-up.

Another error: don't use pin 1 (or 0). It is needed for sketch upload and serial monitor. Up to now, it has not caused a problem because your buttons are floating. But once you have fixed that, using pin 1 could become a problem.

A further error: one of your servos is connected to 3.3V pin. That voltage is too low to power a servo, I think, and even if it is, the pin may not be able to supply enough current, I'm not sure. Both servos should be connected to 5V, and you should probably make sure that both servos do not move at the same time, because that might be more current than the Uno can supply.

My new code

int startpin = A0;
int nextpin = A1;

 int buttonpin1 = 2;
 int buttonpin2 = 3;
 int buttonpin3 = 4;
 int buttonpin4 = 5;
 int buttonpin5 = 6;
 int buttonpin6 = 7;
 int buttonpin7 = 8;
 int buttonpin8 = 9;
 int buttonpin9 = 10;
 int buttonpin10 = 11;

int startbuttonstate = 0;
int nextbuttonstate = 0;
int button1state = 0;
int button2state = 0;
int button3state = 0;
int button4state = 0;
int button5state = 0;
int button6state = 0;
int button7state = 0;
int button8state = 0;
int button9state = 0;
int button10state = 0;

//2 servo to rotate 2 plates
#include <Servo.h>
const int servoPin1 = 12;  //outer circle
Servo Servo1;
const int servoPin2 = 13;   //inner circle
Servo Servo2;

int buzzer = A2;
#include "pitches.h"
//success
int melody1[] = {
  NOTE_C3, NOTE_E3, NOTE_G3, NOTE_C4
};
int noteDurations1[] = {
  4, 4, 4, 4
};
//fail
int melody2[] = {
  NOTE_D2, NOTE_D2, NOTE_D2
};
int noteDurations2[] = {
  4, 4, 4
};

//pick 3 random fingers
#include <EEPROM.h>
template <class T> int EEPROM_writeAnything(int ee, const T& value)
{
  const byte* p = (const byte*)(const void*)&value;
  int j;
  for (j = 0; j < sizeof(value); j++)
    EEPROM.write(ee++, *p++);
  return j;
}
template <class T> int EEPROM_readAnything(int ee, T& value)
{
  byte* p = (byte*)(void*)&value;
  int j;
  for (j = 0; j < sizeof(value); j++)
    *p++ = EEPROM.read(ee++);
  return j;
}
void BetterRandomSeed( void )
{
  unsigned long __seed;

  EEPROM_readAnything( 0, __seed );

  srandom( __seed );
}
long BetterRandom( void )
{
  long __seed;

  __seed = random();

  EEPROM_writeAnything( 0, __seed );

  return ( __seed );
}

long BetterRandom( long howbig )
{
  if ( howbig == 0 )
  {
    return 0;
  }
  return ( BetterRandom() % howbig );
}

long BetterRandom( long howsmall, long howbig )
{
  if ( howsmall >= howbig )
  {
    return howsmall;
  }
  long diff = howbig - howsmall;

  return ( BetterRandom(diff) + howsmall );
}

char *fingers[] = {"R thumb", "R index", "R middle", "R ring", "R pinky",
                   "L thumb", "L index", "L middle", "L ring", "L pinky"
                  };
long finger1;
long finger2;
long finger3;
int val = 0;

//pick 3 random no.
int randomnum[10];
int amountofnum = 3;
const int minrandomnum = 1;
const int maxrandomnum = 10;
boolean duplicatefound;
int duplicatetotal;
const boolean debug = false;

//numbers for 2nd round (deal with it later)
int R1, R2, R3;

//compare if buttons input match generated numbers
int pwcount;
byte combination[] = "counter1 counter1 counter1";
//above maybe wrong
byte userInput[3];

void setup() {
  Serial.begin(9600);

  pinMode (buttonpin1, INPUT_PULLUP);
  pinMode (buttonpin2, INPUT_PULLUP);
  pinMode (buttonpin3, INPUT_PULLUP);
  pinMode (buttonpin4, INPUT_PULLUP);
  pinMode (buttonpin5, INPUT_PULLUP);
  pinMode (buttonpin6, INPUT_PULLUP);
  pinMode (buttonpin7, INPUT_PULLUP);
  pinMode (buttonpin8, INPUT_PULLUP);
  pinMode (buttonpin9, INPUT_PULLUP);
  pinMode (buttonpin10, INPUT_PULLUP);

  pinMode (startpin, INPUT);
  pinMode (nextpin, INPUT);
  //2 servo motors
  Servo1.attach(servoPin1);
  Servo2.attach(servoPin2);

  pinMode(buzzer, OUTPUT);
  noTone(buzzer);

  randomSeed(analogRead(0));
  BetterRandomSeed();
}

void loop() {

  button1state = digitalRead(buttonpin1);
  button2state = digitalRead(buttonpin2);
  button3state = digitalRead(buttonpin3);
  button4state = digitalRead(buttonpin4);
  button5state = digitalRead(buttonpin5);
  button6state = digitalRead(buttonpin6);
  button7state = digitalRead(buttonpin7);
  button8state = digitalRead(buttonpin8);
  button9state = digitalRead(buttonpin9);
  button10state = digitalRead(buttonpin10);

  startbuttonstate = analogRead(startpin);
  nextbuttonstate = analogRead(nextpin);
  Serial.println(startbuttonstate);  //just for checking
  Serial.println(nextbuttonstate);

  //start 
  if (startbuttonstate == LOW && nextbuttonstate == LOW) {
    noTone(buzzer);
    Serial.println("Press START");
    delay(3000);
  }
  //ask how many players
  if (startbuttonstate == HIGH) {
    Serial.println ("How many player?");
    delay(500);
    Serial. println ("Button 1 = 1; Button 2 = 2");
    delay(4000);
  }

  int button1state = digitalRead(buttonpin2);
  int button2state = digitalRead(buttonpin3);

  if (button1state == HIGH) {
    
    Serial.println(" Hi player1 ");
    delay(2000);
    Serial.println(" Let's start! ");
    delay(2000);
    Serial.println(" Press NEXT to begin.");
  }
  //assign 3 random no.
  while (analogRead(nextbuttonstate) == LOW);
  if (debug == true) {
    Serial.println ("Generating");
  }

  int duplicatetotal = 0;
  for (int counter1 = 0; counter1 < amountofnum; counter1++) {
    duplicatefound = true;

    while (duplicatefound == true) {
      randomnum[counter1] = random(minrandomnum, maxrandomnum);

      duplicatefound = false;

      for (int counter2 = 0; counter2 < counter1; counter2++) {
        if (randomnum[counter1] == randomnum[counter2]) {
          duplicatefound = true;
          duplicatetotal++;
        }
      }
    }
  }
  //Finishing generate no.
  for (int counter1 = 0; counter1 < amountofnum; counter1++) {
    Serial.print("Number ");
    Serial.print(counter1);
    Serial.print(" is: ");
    Serial.println(randomnum[counter1]);
    delay (500);

  }
  //3 fingers the player should use

  finger1 = BetterRandom(sizeof(fingers) / sizeof(char*));
  do {
    finger2 = BetterRandom(sizeof(fingers) / sizeof(char*));
  }
  while ( finger2 == finger1 );
  do {
    finger3 = BetterRandom(sizeof(fingers) / sizeof(char*));
  }
  while ( finger3 == finger2 );
  Serial.println("Press with these fingers: ");
  Serial.println(fingers[finger1]);
  Serial.println(fingers[finger2]);
  Serial.println(fingers[finger3]);
  delay(1000);

  //Check if buttons input match generated numbers
  if (button1state == HIGH) {
    //problem: will pressing 1 cause two things to happen?
    userInput[pwcount] = '1';
    pwcount++;
    delay(300);
    Serial.print('1');
  }
  if (button2state == HIGH) {
    //same problem if have 2 players?
    userInput[pwcount] = '2';
    pwcount++;
    delay(300);
    Serial.print('2');
  }
  if (button3state == HIGH) {
    userInput[pwcount] = '3';
    pwcount++;
    delay(300);
    Serial.print('3');
  }
  if (button4state == HIGH) {
    userInput[pwcount] = '4';
    pwcount++;
    delay(300);
    Serial.print('4');
  }
  if (button5state == HIGH) {
    userInput[pwcount] = '5';
    pwcount++;
    delay(300);
    Serial.print('5');
  }
  if (button6state == HIGH) {
    userInput[pwcount] = '6';
    pwcount++;
    delay(300);
    Serial.print('6');
  }
  if (button7state == HIGH) {
    userInput[pwcount] = '7';
    pwcount++;
    delay(300);
    Serial.print('7');
  }
  if (button8state == HIGH) {
    userInput[pwcount] = '8';
    pwcount++;
    delay(300);
    Serial.print('8');
  }
  if (button9state == HIGH) {
    userInput[pwcount] = '9';
    pwcount++;
    delay(300);
    Serial.print('9');
  }
  if (button10state == HIGH) {
    //Why 10 not appear blue?
    userInput[pwcount] = '10';
    pwcount++;
    delay(300);
    Serial.print('10');
  }

  //Match
  for (byte n = 0; n <= 3; n++) {
    if (userInput[pwcount] == combination[n] && pwcount >= 3) {
      Serial.println("Success! ^_^ Press NEXT");
      pwcount = 0;
      delay(1000);
      for (int thisNote = 0; thisNote < 4; thisNote++) {

        int noteDuration1 = 1000 / noteDurations1[thisNote];
        tone(buzzer, melody1[thisNote], noteDuration1);

        int pauseBetweenNotes = noteDuration1 * 1.30;
        delay(pauseBetweenNotes);
        noTone(buzzer);
        break;
      }
      //Not match
    } else {
      if (userInput[n] != combination[n] && pwcount >= 3) {
        Serial.println("Fail! T_T Press NEXT");
        pwcount = 0;
        n = 0;
        delay(1000);

        for (int thisNote = 0; thisNote < 3; thisNote++) {

          int noteDuration2 = 1000 / noteDurations2[thisNote];
          tone(buzzer, melody2[thisNote], noteDuration2);

          int pauseBetweenNotes = noteDuration2 * 1.30;
          delay(pauseBetweenNotes);
          noTone(buzzer);
          break;
        }
      }
    }
  }
  //play 1 more round <round 2>
}   //void loop

Thanks, Paul.
Some lines are missing (e.g. how many players), and again, some lines keep appearing although I didn't press any buttons. It's good news that the random fingers appeared.
Any help will be appreciated.

Here's the output in the Serial Monitor:

601
308
 Hi player1 
 Let's start! 
 Press NEXT to begin.
Number 0 is: 1
Number 1 is: 2
Number 2 is: 9
Press with these fingers: 
L ring
R middle
L thumb
12345678912592Fail! T_T Press NEXT
540
259
 Hi player1 
 Let's start! 
 Press NEXT to begin.
Number 0 is: 7
Number 1 is: 6
Number 2 is: 5
Press with these fingers: 
R middle
L middle
L index
12345678912592Fail! T_T Press NEXT
387

To make things simpler, I haven't connected the servos yet.
Here's my new diagram (diagram2):

Welcome to the forum. I am interested in your project because I am always looking for challenges to put into our annual family escape room game. (It started out as Easter Egg hunts and evolved from that as our kids got older).

Please don't use Fritzing pictures. Fritzing pictures are not schematics and many people here won't try to decipher Fritzing pictures.

This tells me more than any Fritzing picture.

switchx.jpg

switchx.jpg

That right-most button is a serious mistake. Press that and 5V will be shorted to directly ground, probably resetting the Uno and possibly damaging or causing USB disconnection as your pc/laptop tries to protect itself.

Your code has taken a step backwards. At least before the pin numbers were in an array. As a hint, any time you have variable names ending 1, 2, 3... you should probably be using an array.

Your code is full of things you have cut & pasted without understanding them, or even if you need them at all. The "BetterRandom" function, for example. Why do you think the standard arduino random function will not be good enough? Do you have any idea why that code is writing to EEPROM or what EEPROM is, and how quickly it can wear out and fail if used incorrectly?

To me, you seem completely out of your depth right now. I think you should take a step back from the project. Spend time working through some basic arduino tutorials, learning the fundamentals of basic electronic circuits and code.

I agree with Paul- why the heck are you saving the random seed in EEPROM?

Start small. If you are new to Arduino, just code one function at a time. When you have it working, add the next.

And please stop using Fritzing. You will get more response here if you draw a proper schematic. Use pencil and paper then scan or photograph it to post. This thread has been read 125 times but only Paul took the time to analyze your Fritzing picture to see the glaring hardware error.

BTW, if the source of your project is the Instructables website, then there’s an 80% chance that there are errors and a 10% chance that it would ever work.

As I said, I am interested in your project, but I won’t be working on the next game until next spring.

Start small. Start with just one button and a function to print random numbers to simulate the challenge. You can add more buttons later. Also later, you can test if the buttons pressed match the challenge pattern. (Hint, read the port, not the GPIO pins. It would simplify your code to read all the button states in one step). If you write your program this way you will understand how it works.