Shuffleboard lcd scoreboard help

trying my 2nd project got a 2 button score board on the go. first thing i need help with is the reset, Want to push both buttons at once to reset. but what i have so far it will only reset the first number, if you have a score of 15 it resets to 05. the second thing is making the score big number witch im totally lost, copied custom character but have no idea how to use them. its a 20x4 lcd hres the code so far


#include <Wire.h> 
#include <LiquidCrystal_I2C.h> 

// Wiring: SDA pin is connected to A4 and SCL pin to A5.
LiquidCrystal_I2C lcd = LiquidCrystal_I2C(0x27, 20, 4); // Change to (0x27,16,2) or (0x27,20,4)for screen size

const int button1 = 5;         // GPIO 5 for the button 1
const int button2 = 7;         // GPIO 7 for the button 2

int player1;
int player2;

int lastbutton1State,lastbutton2State;

// Define the bit patters for each of our custom chars. These
// are 5 bits wide and 8 dots deep
uint8_t custChar[8][8] = {
  {31, 31, 31, 0, 0, 0, 0, 0},      // Small top line - 0
  {0, 0, 0, 0, 0, 31, 31, 31},      // Small bottom line - 1
  {31, 0, 0, 0, 0, 0, 0, 31},     // Small lines top and bottom -2
  {0, 0, 0, 0, 0, 0,  0, 31},       // Thin bottom line - 3
  {31, 31, 31, 31, 31, 31, 15, 7},  // Left bottom chamfer full - 4
  {28, 30, 31, 31, 31, 31, 31, 31}, // Right top chamfer full -5
  {31, 31, 31, 31, 31, 31, 30, 28}, // Right bottom chamfer full -6
  {7, 15, 31, 31, 31, 31, 31, 31},  // Left top chamfer full -7
};

// Define our numbers 0 thru 9
// 254 is blank and 255 is the "Full Block"
uint8_t bigNums[10][6] = {
  {7, 0, 5, 4, 1, 6},         //0
  {0, 5, 254, 1, 255, 1},     //1
  {0, 2, 5, 7, 3, 1},         //2
  {0, 2, 5, 1, 3, 6},         //3
  {7, 3, 255, 254, 254, 255}, //4
  {7, 2, 0, 1, 3, 6},         //5
  {7, 2, 0, 4, 3, 6},         //6
  {0, 0, 5, 254, 7, 254},   //7
  {7, 2, 5, 4, 3, 6},         //8
  {7, 2, 5, 1, 3, 6},         //9
};

void setup() {
  pinMode(button1, INPUT);
  pinMode(button2, INPUT);            //defie button as input
  
  
  
  // Initiate the LCD:
  lcd.init();
  lcd.backlight();
}
void loop() {
  int button1State = digitalRead(button1);
  int button2State = digitalRead(button2);
  
  if (button1State == HIGH) 
  {  
   player1 ++;
   delay(300);
  } 
  if (button2State == HIGH) 
  {  
   player2 ++;
   delay(300);
  } 
 if (button1State & button2State == HIGH) 
  {  
   player2 = 0;
   player1 = 0;
   delay(300);
  }   
  
  
  //lcd.clear();         //lcd.clear();clears screen
 //player set up
  lcd.setCursor(0, 0); // first number is left to right second number up and dowm 0 first row.
  lcd.print("PLAYER 1"); // Print the player name
  lcd.setCursor(12, 0);
  lcd.print("PLAYER 2");

//score set up player 1
  lcd.setCursor(0, 2);
  lcd.print(player1);
  
//score set up player 2      
      lcd.setCursor(12, 2);
      lcd.print(player2);
  
  lastbutton1State = button1State;
  lastbutton2State = button2State;

}

Try

 if (button1State == HIGH && button2State == HIGH) 

...if that works we'll look at the second issue

As for the custom characters on the LCD... what exactly are you trying to do?

Your LCD has 4 lines of 20 characters.

Each character is made up of an 8x5 grid of pixels... and you can create you own characters. that is you can define your own 8x5 on/off for a given character.

Hello
You may design a button handler who takes care about debouncing and the desired processing.
Have a nice day and enjoy coding in C++.

consider

// check multiple buttons and toggle LEDs
#undef MyHW
#ifdef MyHW
byte pinsBut [] = { A1, A2};
#else
byte pinsBut [] = {  5,  7};
#endif


enum { Off = HIGH, On = LOW };

#define N_BUT   sizeof(pinsBut)

byte butState [N_BUT];

int player1;
int player2;

// -----------------------------------------------------------------------------
int
chkButtons ()
{
    for (unsigned n = 0; n < sizeof(pinsBut); n++)  {
        byte but = digitalRead (pinsBut [n]);

        if (butState [n] != but)  {
            butState [n] = but;

            delay (10);     // debounce

            if (On == but)
                return n;
        }
    }
    return -1;
}

// -----------------------------------------------------------------------------
void
update ()
{
    char s [20];
    sprintf (s, "%3d %3d", player1, player2);
    Serial.println (s);
}

// -----------------------------------------------------------------------------
void
loop ()
{
    switch (chkButtons ())  {
    case 0:
        player1++;
        update ();
        break;

    case 1:
        player2++;
        update ();
        break;
    }

    if (LOW == butState [0]  && LOW == butState [1])  {
        if (player1 || player2)  {
            player1 = player2 = 0;
            update ();
        }
    }
}

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

    for (unsigned n = 0; n < sizeof(pinsBut); n++)  {
        pinMode (pinsBut [n], INPUT_PULLUP);
        butState [n] = digitalRead (pinsBut [n]);
    }
}

that gives me the same result dont think i explanied it right, when i hit both button it does reset both players score but only the first digit of each player. score of say 8 : 5 gets reset to 0 : 0 but if it was 15 : 21 it resets to 05 : 01

For the custom characters just want to make the numbers for the score bigger. player 1 and player 2 just want to leave same size.

This is because you are only overwriting the first digit with the statement below once the number is 0.

//score set up player 1
  lcd.setCursor(0, 2);
  lcd.print(player1);
  
//score set up player 2      
      lcd.setCursor(12, 2);
      lcd.print(player2);

Try..

//score set up player 1
  lcd.setCursor(0, 2);
  lcd.print("  ")';
  lcd.setCursor(0, 2);
  lcd.print(player1);
  
//score set up player 2      
      lcd.setCursor(12, 2);
      lcd.print("  ");
      lcd.setCursor(12, 2);
      lcd.print(player2);

What do you mean "bigger" - they can only be as big as 8x5 pixels?

Draw a picture of what you expect the "bigger" number to look like.

The big numbers are a bit clearer if you use the bit patterns in the definitions. Each number is made up of six characters, chosen from the eight custom characters, plus characters 254 and 255 from the LCD controller's character set (254 is all pixels off, 255 is a solid block with all pixels on).

// Define the bit patters for each of our custom chars. These
// are 5 bits wide and 8 dots deep
uint8_t custChar[8][8] = {
  // Small top line - 0
  {
    0b11111,
    0b11111,
    0b11111,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00000
  },
  // Small bottom line - 1
  {
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b11111,
    0b11111,
    0b11111
  },
  // Small lines top and bottom -2
  {
    0b11111,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b11111
  },
  // Thin bottom line - 3
  {
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b00000,
    0b11111
  },
  // Left bottom chamfer full - 4
  {
    0b11111,
    0b11111,
    0b11111,
    0b11111,
    0b11111,
    0b11111,
    0b01111,
    0b00111
  },
  // Right top chamfer full -5
  {
    0b11100,
    0b11110,
    0b11111,
    0b11111,
    0b11111,
    0b11111,
    0b11111,
    0b11111
  },
  // Right bottom chamfer full -6
  {
    0b11111,
    0b11111,
    0b11111,
    0b11111,
    0b11111,
    0b11111,
    0b11110,
    0b11100
  },
  // Left top chamfer full -7
  {
    0b00111,
    0b01111,
    0b11111,
    0b11111,
    0b11111,
    0b11111,
    0b11111,
    0b11111
  },
};

Here is an examples of the coding for the large number zero:

uint8_t bigNums[10][6] = {
  {7, 0, 5, 4, 1, 6},         //0

  //      7     0     5
  //    00111 11111 11100
  //    01111 11111 11110
  //    11111 11111 11111
  //    11111 00000 11111
  //    11111 00000 11111
  //    11111 00000 11111
  //    11111 00000 11111
  //    11111 00000 11111
  //
  //    11111 00000 11111
  //    11111 00000 11111
  //    11111 00000 11111
  //    11111 00000 11111
  //    11111 00000 11111
  //    11111 11111 11111
  //    01111 11111 11110
  //    00111 11111 11100
  //      4     1     6

Ah I see. So using 2 lines per digit... got it.

Hello
Please keep in mind the LCD is able to handle eight user defined charaters only.

... but they can be continually redefined as required I guess.

Nice idea, has to be checked

I have not taken the time to test the code, but I'm assuming that all ten digits are made from the eight custom characters in the code. Redefining the custom characters is possible, but only eight can be used on the LCD at one time, redefining a custom character that is being displayed will immediately change what is being displayed.

thank u that fixed my reset problem