Sorry, there is the code
int x=1;// take int value as 1
void setup() {
pinMode(52,INPUT_PULLUP); //P A1
pinMode(50,INPUT_PULLUP); //P A2
pinMode(48,INPUT_PULLUP); //P A3
pinMode(46,INPUT_PULLUP); //P A4
pinMode(44,INPUT_PULLUP); //P A5
pinMode(42,INPUT_PULLUP); //P B1
pinMode(40,INPUT_PULLUP); //P B2
pinMode(38,INPUT_PULLUP); //P B3
pinMode(36,INPUT_PULLUP); //P B4
pinMode(34,INPUT_PULLUP); //P B5
pinMode(53,OUTPUT); //P A1
pinMode(51,OUTPUT); //P A2
pinMode(49,OUTPUT); //P A3
pinMode(47,OUTPUT); //P A4
pinMode(45,OUTPUT); //P A5
pinMode(43,OUTPUT); //P B1
pinMode(41,OUTPUT); //P B2
pinMode(39,OUTPUT); //P B3
pinMode(37,OUTPUT); //P B4
pinMode(35,OUTPUT); //P B5
pinMode(33,OUTPUT); // buzzer
pinMode(32,OUTPUT); // TeamGreen
pinMode(30,OUTPUT); // TeamRed
pinMode(31,OUTPUT); // ReadyLED
// set initially LED to Ready
digitalWrite(53,LOW); //P A1
digitalWrite(51,LOW); //P A2
digitalWrite(49,LOW); //P A3
digitalWrite(47,LOW); //P A4
digitalWrite(45,LOW); //P A5
digitalWrite(43,LOW); //P B1
digitalWrite(41,LOW); //P B2
digitalWrite(39,LOW); //P B3
digitalWrite(37,LOW); //P B4
digitalWrite(35,LOW); //P B5
digitalWrite(33,LOW); // buzzer
digitalWrite(32,LOW); // Team Green
digitalWrite(30,LOW); // Team Red
digitalWrite(31,HIGH); // Ready LED
}
void loop()
{
int a=digitalRead(52); // reading pin values for 10 buttons
int b=digitalRead(50);
int c=digitalRead(48);
int d=digitalRead(46);
int e=digitalRead(44);
int f=digitalRead(42);
int g=digitalRead(40);
int h=digitalRead(38);
int i=digitalRead(36);
int j=digitalRead(34);
if(a==LOW) //if 1 player press button
{ if(x==1) // check if x is 1 if yes then execute the code
{
digitalWrite(53,HIGH); //P A1
digitalWrite(51,LOW); //P A2
digitalWrite(49,LOW); //P A3
digitalWrite(47,LOW); //P A4
digitalWrite(45,LOW); //P A5
digitalWrite(43,LOW); //P B1
digitalWrite(41,LOW); //P B2
digitalWrite(39,LOW); //P B3
digitalWrite(37,LOW); //P B4
digitalWrite(35,LOW); //P B5
digitalWrite(33,HIGH); // buzzer
digitalWrite(32,HIGH); // TeamGreen
digitalWrite(30,LOW); // TeamRed
digitalWrite(31,LOW); // ReadyLED
x++; //increment x
}
}
else if(b==LOW) //if player 2 press button
{
if(x==1) // check if x is 1 if yes then execute the code
{
digitalWrite(53,LOW); //P A1
digitalWrite(51,HIGH); //P A2
digitalWrite(49,LOW); //P A3
digitalWrite(47,LOW); //P A4
digitalWrite(45,LOW); //P A5
digitalWrite(43,LOW); //P B1
digitalWrite(41,LOW); //P B2
digitalWrite(39,LOW); //P B3
digitalWrite(37,LOW); //P B4
digitalWrite(35,LOW); //P B5
digitalWrite(33,HIGH); // buzzer
digitalWrite(32,HIGH); // TeamGreen
digitalWrite(30,LOW); // TeamRed
digitalWrite(31,LOW); // ReadyLED
x++;
}
}
else if(c==LOW) //if player 3 press button
{
if(x==1) // check if x is 1 if yes then execute the code
{
digitalWrite(53,LOW); //P A1
digitalWrite(51,LOW); //P A2
digitalWrite(49,HIGH); //P A3
digitalWrite(47,LOW); //P A4
digitalWrite(45,LOW); //P A5
digitalWrite(43,LOW); //P B1
digitalWrite(41,LOW); //P B2
digitalWrite(39,LOW); //P B3
digitalWrite(37,LOW); //P B4
digitalWrite(35,LOW); //P B5
digitalWrite(33,HIGH); // buzzer
digitalWrite(32,HIGH); // TeamGreen
digitalWrite(30,LOW); // TeamRed
digitalWrite(31,LOW); // ReadyLED
x++;
}
}
else if(d==LOW) //if player 4 press button
{ if(x==1) // check if x is 1 if yes then execute the code
{
digitalWrite(53,LOW); //P A1
digitalWrite(51,LOW); //P A2
digitalWrite(49,LOW); //P A3
digitalWrite(47,HIGH); //P A4
digitalWrite(45,LOW); //P A5
digitalWrite(43,LOW); //P B1
digitalWrite(41,LOW); //P B2
digitalWrite(39,LOW); //P B3
digitalWrite(37,LOW); //P B4
digitalWrite(35,LOW); //P B5
digitalWrite(33,HIGH); // buzzer
digitalWrite(32,HIGH); // TeamGreen
digitalWrite(30,LOW); // TeamRed
digitalWrite(31,LOW); // ReadyLED
x++;
}
}
else if(e==LOW) //if player 5 press button
{
if(x==1) // check if x is 1 if yes then execute the code
{
digitalWrite(53,LOW); //P A1
digitalWrite(51,LOW); //P A2
digitalWrite(49,LOW); //P A3
digitalWrite(47,LOW); //P A4
digitalWrite(45,HIGH); //P A5
digitalWrite(43,LOW); //P B1
digitalWrite(41,LOW); //P B2
digitalWrite(39,LOW); //P B3
digitalWrite(37,LOW); //P B4
digitalWrite(35,LOW); //P B5
digitalWrite(33,HIGH); // buzzer
digitalWrite(32,HIGH); // TeamGreen
digitalWrite(30,LOW); // TeamRed
digitalWrite(31,LOW); // ReadyLED
x++;
}
}
else if(f==LOW) //if player 6 press button
{ if(x==1) // check if x is 1 if yes then execute the code
{
digitalWrite(53,LOW); //P A1
digitalWrite(51,LOW); //P A2
digitalWrite(49,LOW); //P A3
digitalWrite(47,LOW); //P A4
digitalWrite(45,LOW); //P A5
digitalWrite(43,HIGH); //P B1
digitalWrite(41,LOW); //P B2
digitalWrite(39,LOW); //P B3
digitalWrite(37,LOW); //P B4
digitalWrite(35,LOW); //P B5
digitalWrite(33,HIGH); // buzzer
digitalWrite(32,LOW); // TeamGreen
digitalWrite(30,HIGH); // TeamRed
digitalWrite(31,LOW); // ReadyLED
x++;
}
}
else if(g==LOW) //if player 7 press button
{ if(x==1) // check if x is 1 if yes then execute the code
{
digitalWrite(53,LOW); //P A1
digitalWrite(51,LOW); //P A2
digitalWrite(49,LOW); //P A3
digitalWrite(47,LOW); //P A4
digitalWrite(45,LOW); //P A5
digitalWrite(43,LOW); //P B1
digitalWrite(41,HIGH); //P B2
digitalWrite(39,LOW); //P B3
digitalWrite(37,LOW); //P B4
digitalWrite(35,LOW); //P B5
digitalWrite(33,HIGH); // buzzer
digitalWrite(32,LOW); // TeamGreen
digitalWrite(30,HIGH); // TeamRed
digitalWrite(31,LOW); // ReadyLED
x++;
}
}
else if(h==LOW) //if player 8 press button
{ if(x==1) // check if x is 1 if yes then execute the code
{
digitalWrite(53,LOW); //P A1
digitalWrite(51,LOW); //P A2
digitalWrite(49,LOW); //P A3
digitalWrite(47,LOW); //P A4
digitalWrite(45,LOW); //P A5
digitalWrite(43,LOW); //P B1
digitalWrite(41,LOW); //P B2
digitalWrite(39,HIGH); //P B3
digitalWrite(37,LOW); //P B4
digitalWrite(35,LOW); //P B5
digitalWrite(33,HIGH); // buzzer
digitalWrite(32,LOW); // TeamGreen
digitalWrite(30,HIGH); // TeamRed
digitalWrite(31,LOW); // ReadyLED
x++;
}
}
else if(i==LOW) //if player 9 press button
{ if(x==1) // check if x is 1 if yes then execute the code
{
digitalWrite(53,LOW); //P A1
digitalWrite(51,LOW); //P A2
digitalWrite(49,LOW); //P A3
digitalWrite(47,LOW); //P A4
digitalWrite(45,LOW); //P A5
digitalWrite(43,LOW); //P B1
digitalWrite(41,LOW); //P B2
digitalWrite(39,LOW); //P B3
digitalWrite(37,HIGH); //P B4
digitalWrite(35,LOW); //P B5
digitalWrite(33,HIGH); // buzzer
digitalWrite(32,LOW); // TeamGreen
digitalWrite(30,HIGH); // TeamRed
digitalWrite(31,LOW); // ReadyLED
x++;
}
}
else if(j==LOW) //if player 10 press button
{ if(x==1) // check if x is 1 if yes then execute the code
{
digitalWrite(53,LOW); //P A1
digitalWrite(51,LOW); //P A2
digitalWrite(49,LOW); //P A3
digitalWrite(47,LOW); //P A4
digitalWrite(45,LOW); //P A5
digitalWrite(43,LOW); //P B1
digitalWrite(41,LOW); //P B2
digitalWrite(39,LOW); //P B3
digitalWrite(37,LOW); //P B4
digitalWrite(35,HIGH); //P B5
digitalWrite(33,HIGH); // buzzer
digitalWrite(32,LOW); // TeamGreen
digitalWrite(30,HIGH); // TeamRed
digitalWrite(31,LOW); // ReadyLED
x++;
}
}
}
[/code]