Blink LEDs with pushbuttons

Hi,
I'm new with Arduino. I have project to upgrade my son's Power Wheels with turn signal.

I used code from Moiraredneck's post

const int leftButton = 2;
const int leftLedPin =  10;      

boolean lLedState = LOW;
boolean previousButtonState = HIGH;
boolean lButtonState = LOW;
boolean serialCheck = LOW;

long duration = 0;

unsigned long previousMillis = 0;        

// constants won't change : how long LED is on
const long interval = 500;

void setup() 
{
  Serial.begin(9600);
  // set the digital pin as output:
  pinMode(leftLedPin, OUTPUT);
  pinMode(leftButton, INPUT);
}

void loop()
{
  unsigned long currentMillis = millis();
 
  if(currentMillis - previousMillis >= interval && lButtonState == HIGH ) 
  { 
    previousMillis = currentMillis;   
  //  Serial.println(buttonState);
 //   if(lButtonState == HIGH)
 //   {
       if (lLedState == LOW)
       {
         lLedState = HIGH;
         Serial.println("led set high");
       }
       else
       {
         lLedState = LOW;
       }
   // }
    
    if (millis() >= duration)
    {
      Serial.println("duration completed");
      previousButtonState = lButtonState;
      lButtonState = LOW;
      lLedState = LOW;
    }
    // set the LED with the ledState of the variable:
    digitalWrite(leftLedPin, ledState);
  }
  
  if(digitalRead(leftButton) == HIGH)
  {
    if(previousButtonState == HIGH)
    {
       Serial.println("pressed");
     //  Serial.println(currentMillis);
      lButtonState = HIGH;
    }
    else
    {
      buttonState = LOW;
    }
    delay(150); //debouncing
    duration = millis() + 5000; // How long the loop lasts
  }
}

This works for one side (left),i know how add more LEDs to this, but my problem is I don't know how to code for another button for right side.

Copy all the left stuff, paste it in the proper place, and change left to right. Not exactly rocket science.

Of course, that code is crap. It is far more complex than it needs to be to read a switch, and determine if it changed state, and then blink an LED if the switch has been pressed an odd number of times.

How many variables does it take to determine that the current state of the switch is, or is not, the same as the previous state of that switch? How many do you use?

Scrap that crap. Start over with the state change detection example. Add a boolean variable, leftTurnOn, initialized to false. If the switch becomes pressed an odd number of times, set leftTurnOn to true. If the switch becomes pressed an even number of times, set it to true.

Completely independently of the switch processing, if leftTurnOn is true, determine if it is time to change the state of the left turn signal light.

Do THAT in a function, that takes a pin number, so you can use the same function for the right signal simply be passing the right side LED pin number to the function.

If you want someone else to write the code for you, click on Report to Moderator, and ask to have your post moved to Gigs and Collaboration. Then, go there, and add a reply indicating how much you are willing to pay.