I am trying to figure out how to use && with in a custom "keyboard" using keypad.h
Basically if the state of the key is 1(aka active) it should be able to execute code then change the state to 0 so you can no longer press it, but if the state of the key is 0, it should not do anything.
Below is the code, any advice would be appreciated.
if(state == 1){
if (customKey){
switch (customKey){
case '0' && player1Avail == 1: {
player1Avail = 0; //make the button unavailable
for (int i = 0; i < 2; i++){leds[button1[i]] = CRGB greenfull;}
for (int i = 0; i < 2; i++){leds[button2[i]] = CRGB redfull;}
for (int i = 0; i < 2; i++){leds[button3[i]] = CRGB redfull;}
Serial.println("player1 buzzed in");
state = 2;
}}}
}