push button is taking 2 clicks to start running properly !! help !!

hello guys,
i am having a problem, my push buttons are taking 2 first clicks to turn the specific LEDs on, when i first click a push button the led is always off but when i click it again it turns on, then i can click on and off so what might be the problem i have been working on this since yesterday and couldn’t manage to solve it, i changed my sketch like 50 times and nothing, so any idea ?

here is my codes for the receiving arduino because it is a serial communication between 3 arduinos, the first for the pushbuttons, the second for displays and the third for the LEDs :

2nd arduino:

//For the 2 digits displays///////
byte datapin = 2;
byte clockpin = 3;
byte latchpin = 4;

byte datapin2 = 7;
byte clockpin2 = 8;
byte latchpin2 = 9;

byte First = 5;
byte Second = 6;
byte Third = 10;
byte Fourth = 11;

int times;
byte segments[14] = {0b11111111,  //Blank - 0
                     0b00101011, //n - 1
                     0b10000110, //E - 2
                     0b00000111, //t - 3
                     0b10101111, //r - 4
                     0b11001111, //l - 5
                     0b10000011, //b - 6
                     0b11000000, //O - 7
                     0b11100011, //u - 8
                     0b11010101, //v - 9
                     0b11000111, //L - 10
                     0b11001111, //i - 11
                     0b11101010,  //M - 12
                     0b10001001
                     
                   };
                     

byte FirstDigit;
byte SecondDigit;
byte ThirdDigit;
byte FourthDigit;

byte FirstD;
byte SecondD;
byte ThirdD;
byte FourthD;

//these pins for the gear number display///////////////////////////////////////////////////////
byte latchPin0 = 15; //latch pin
byte clockPin0 = 16; //clock pin
byte dataPin0 = 14; //data pin

byte gearDisplay = 0;

int gearBox = 0;

byte segments1Digit[7] = {0b00000011, //0 - position 1
                          0b10011111, //1 - position 2
                          0b00100101, //2 - position 3
                          0b00001101, //3 - position 4
                          0b10011001, //4 - position 5
                          0b01001001, //5 - position 6
                          0b01000001, //6 - position 7
                         };
                   
int burnoutOn = 0;
int burnoutCounter = 0;

int neutralOn = 0;
int neutralCounter = 0;

int reverseOn = 0;
int reverseCounter = 0;

int limiterOn = 0;
int limiterCounter = 0;

int camOn = 0;
int camCounter = 0;

void setup()
{
  Serial.begin(9600);
  
  for(int x = 2; x < 20; x++){
    pinMode(x, OUTPUT);
  }
  
  digitalWrite(Second,HIGH);
  digitalWrite(First,HIGH);
  digitalWrite(datapin,LOW);
  digitalWrite(latchpin,LOW);
  digitalWrite(clockpin,LOW);
  
  digitalWrite(Fourth,HIGH);
  digitalWrite(Third,HIGH);
  digitalWrite(datapin2,LOW);
  digitalWrite(latchpin2,LOW);
  digitalWrite(clockpin2,LOW);
}

void loop()
{  
  //Puting Limits for the gear box up and down
  if(gearBox > 6){
      gearBox = 6;
    }else if(gearBox < 0){
      gearBox = 0;
    }  
  
  //Read from Serial port
  if(Serial.available() > 0){
    delay(2);
    int value = Serial.read();
    if(value == '+'){
     
      gearBox++;
    
    }
    if(value == '-'){
      
      gearBox--;
    
    }
    
    if(value == 'b'){
      
      burnoutOn = 1;
      Serial.write('w'); //this to turn the red LED on from arduino 3
      
    }
    if(value == 'n'){
      
      neutralOn = 1;
      Serial.write('e'); //this to turn the green LED on from arduino 3
      
    }
    if(value == 'r'){
      
      reverseOn = 1;
      Serial.write('y'); //this to turn the yellow LED on from arduino 3
  
    }
    if(value == 'l'){
      
      limiterOn = 1;
      Serial.write('u'); //this to turn the blue LED on from arduino 3
      
    }
    if(value == 'c'){
      
      camOn = 1;
      
    }

   if(burnoutOn == 1 || neutralOn == 1 || reverseOn == 1 || limiterOn == 1){
    if(burnoutOn == 1){
        
        
        burnoutCounter ++;
        
        if(burnoutCounter == 2){
          burnoutOn =0;
          burnoutCounter = 0;
        }
        
        
      }else if(neutralOn == 1){
        
        
        neutralCounter ++;
        
        if(neutralCounter == 2){
          neutralOn =0;
          neutralCounter = 0;
        }
           
      }else if(reverseOn == 1){
        
        
        reverseCounter ++;
        
        if(reverseCounter == 2){
          
          reverseOn =0;
          reverseCounter = 0;
        }
        
      }else if(limiterOn == 1){
        
        
        limiterCounter ++;
        
        if(limiterCounter == 2){
          limiterOn =0;
          limiterCounter = 0;
        }        
      
      }
      }else{
        FirstD = 144; //this will give me 0, this is second digit
        SecondD = 156; //this will give me 1, this is actully the first digit
        ThirdD = 0; //this is the fourth digit
        FourthD = 0;
      }
    
  }//end of Serial.available
  
    gearDisplay = gearBox;
    updateShiftRegister();
    digitparse();
    lookItUp();
}

void updateShiftRegister()
{
  
  shiftOut(dataPin0, clockPin0, LSBFIRST, segments1Digit[gearDisplay]);
  digitalWrite(latchPin0, LOW);  
  digitalWrite(latchPin0, HIGH);
  
}

void latchit ()
{
  digitalWrite(latchpin,HIGH);
  digitalWrite(latchpin,LOW);
  digitalWrite(latchpin2,HIGH);
  digitalWrite(latchpin2,LOW);
}

void digitparse ()
{
  //from left to right
  FirstDigit = FirstD / 12;
  SecondDigit = SecondD / 12;
  ThirdDigit = ThirdD / 12;  
  FourthDigit = FourthD / 12;   
}


void lookItUp ()
{
  shiftOut(datapin,clockpin,MSBFIRST,segments[FirstDigit]);
  shiftOut(datapin,clockpin,MSBFIRST,segments[SecondDigit]);
  shiftOut(datapin2,clockpin2,MSBFIRST,segments[ThirdDigit]);
  shiftOut(datapin2,clockpin2,MSBFIRST,segments[FourthDigit]);
  latchit();
  dispOn();    
}

void dispOn ()
{
  for(times=0; times < 5; times++) // display interval
  {
    digitalWrite(Second,LOW);
    delay(5);
    digitalWrite(Second,HIGH);
    digitalWrite(First,LOW);
    delay(5);
    digitalWrite(First,HIGH);
    
    digitalWrite(Third,LOW);
    delay(5);
    digitalWrite(Third,HIGH);
    digitalWrite(Fourth,LOW);
    delay(5);
    digitalWrite(Fourth,HIGH);
  }
}

3rd arduino :

byte redLED = 2;
byte greenLED = 3;
byte yellowLED = 4;
byte blueLED = 5;

int redLEDon = 0;
int redLEDcounter = 0;

int greenLEDon = 0;
int greenLEDcounter = 0;

int yellowLEDon = 0;
int yellowLEDcounter = 0;

int blueLEDon = 0;
int blueLEDcounter = 0;

void setup(){
  Serial.begin(9600);
  
  for(int i = 2; i<6; i++){
    pinMode(i, OUTPUT);
    digitalWrite(i, LOW);
  }
  
}

void loop(){
  
  if(Serial.available() > 0){
    greenLEDon = 0;
    redLEDon = 0;
    yellowLEDon = 0;
    blueLEDon = 0;
    
    int value = Serial.read();
    if(value == 'w'){
      //w for the red LED
      redLEDon = 1;

    }
    
    if(value == 'e'){
      //w for the green LED
      greenLEDon = 1;
    }
    
    if(value == 'y'){
      //w for the red LED
      yellowLEDon = 1;

    }
    
    if(value == 'u'){
      //u for the blue LED
      blueLEDon = 1;
    } 
    
    if(redLEDon == 1 || greenLEDon == 1 || yellowLEDon == 1 || blueLEDon == 1){
      if(redLEDon == 1){
        
        
        redLEDcounter++;
        if(redLEDcounter > 2){
          redLEDcounter = 2;
        }
        if(redLEDcounter == 2){
          redLEDon = 0;
          redLEDcounter = 0;
          digitalWrite(redLED, LOW);
        }else{
          digitalWrite(redLED, HIGH);
        }
        
      }else{
        digitalWrite(redLED, LOW);
      }
      
      if(greenLEDon == 1){
        
        greenLEDcounter++;
        if(greenLEDcounter > 2){
          greenLEDcounter = 2;
        }
        if(greenLEDcounter == 2){
          greenLEDon = 0;
          greenLEDcounter = 0;
          digitalWrite(greenLED, LOW);
        }else{
          digitalWrite(greenLED, HIGH);
        }
        
      }else{
        digitalWrite(greenLED, LOW);
      }
      
      if(yellowLEDon == 1){
        
        yellowLEDcounter++;
        if(yellowLEDcounter > 2){
          yellowLEDcounter = 2;
        }
        if(yellowLEDcounter == 2){
          yellowLEDon = 0;
          yellowLEDcounter = 0;
          digitalWrite(yellowLED, LOW);
        }else{
          digitalWrite(yellowLED, HIGH);
        }
        
      }else{
        digitalWrite(yellowLED, LOW);
      }
      
      if(blueLEDon == 1){
        
        blueLEDcounter++;
        if(blueLEDcounter > 2){
          blueLEDcounter = 2;
        }
        if(blueLEDcounter == 2){
          blueLEDon = 0;
          blueLEDcounter = 0;
          digitalWrite(blueLED, LOW);
        }else{
          digitalWrite(blueLED, HIGH);
        }
        
      }else{
        digitalWrite(blueLED, LOW);
      }
      
  }else{
      digitalWrite(redLED, LOW);
      digitalWrite(greenLED, LOW);
      digitalWrite(yellowLED, LOW);
      digitalWrite(blueLED, LOW);
  }
  
  }//end of Serial.available
}

my push buttons are taking 2 first clicks to turn the specific LEDs on,

Be nice to know which Arduino they are connected to, and which code is running on that Arduino.

here are the codes for the 1st arduino which has the push buttons connected to it :

//Arduino number 1

int downShift = 2; //Left paddle shift pin 2
int upShift = 3; //Right paddle shift pin 3
int burnout = 5; //Burnout Button pin 5
int neutral = 6; //Neutral Green Button pin 6
int reverse = 7; //Reverse Button pin 7
int limiter = 8; //Pit Limiter Button pin 8
int cam = 9; //Cam grey Button pin 9

//pin 4 is the white button

//downShift
boolean lastButton1 = LOW; 
boolean currentButton1 = LOW; 

//upShift
boolean lastButton2 = LOW; 
boolean currentButton2 = LOW; 

//burnout
boolean lastButton4 = LOW; 
boolean currentButton4 = LOW;

//neutral
boolean lastButton5 = LOW; 
boolean currentButton5 = LOW; 

//reverse
boolean lastButton6 = LOW; 
boolean currentButton6 = LOW; 

//limiter
boolean lastButton7 = LOW; 
boolean currentButton7 = LOW; 

//cam
boolean lastButton8 = LOW; 
boolean currentButton8 = LOW; 

void setup(){
  Serial.begin(9600);
  for(int i = 2; i<9; i++){
    pinMode(i, INPUT);
  }
  
}

//debounce function
boolean debounce(boolean last, int button)
{
  boolean current = digitalRead(button);
  if(last != current)
  {
    delay(5);
    current = digitalRead(button);
  }
  return current;
}


void loop(){
  //for the downShift
  currentButton1 = debounce(lastButton1, downShift);
  if(lastButton1 == LOW && currentButton1 == HIGH)
  {
    Serial.write('-');
  }
  lastButton1 = currentButton1;
  
  
  //for the upShift
  currentButton2 = debounce(lastButton2, upShift);
  if(lastButton2 == LOW && currentButton2 == HIGH)
  {
    Serial.write('+');
  }
  lastButton2 = currentButton2;
  
  
  //for the burnout
  currentButton4 = debounce(lastButton4, burnout);
  if(lastButton4 == LOW && currentButton4 == HIGH)
  { 
    Serial.write('b');
  }  
  
  lastButton4 = currentButton4;
  
  
  //for the neutral
  currentButton5 = debounce(lastButton5, neutral);
  if(lastButton5 == LOW && currentButton5 == HIGH)
  {
    Serial.write('n');
    
  }
  lastButton5 = currentButton5;
  
  
  //for the reverse
  currentButton6 = debounce(lastButton6, reverse);
  if(lastButton6 == LOW && currentButton6 == HIGH)
  {
    Serial.write('r');
  }
  lastButton6 = currentButton6;
  
  
  //for the limiter
  currentButton7 = debounce(lastButton7, limiter);
  if(lastButton7 == LOW && currentButton7 == HIGH)
  {
    Serial.write('l');
    
  }
  lastButton7 = currentButton7;
  
  
  //for the cam
  currentButton8 = debounce(lastButton8, cam);
  if(lastButton8 == LOW && currentButton8 == HIGH)
  {
     Serial.write('c');
  }
  lastButton8 = currentButton8;
    
}