Trying to interface code with the osoyoo robot car code.

First, Here is the code that I would like to include in the robot code:

Code:
// KITT LIGHT

int ledPins[]={2,3,4,5,6,7,8,9,10};

void setup()
{
// initialize the digital pins (D2-D10) as output.
for(int i =0; i<9; i++)

{
pinMode(ledPins*, OUTPUT);*

  • }*
    }
    void loop()
    {
  • int i = 0;*
  • while (i<9)*
  • {*
  • {*
    _ digitalWrite(ledPins*, HIGH); // Turn the LED on._
    _
    delay(120); // Wait for 100 milliseconds._
    _ digitalWrite(ledPins, LOW); // Turn the LED off.
    i++;
    }
    }
    i=7;
    while(i>0)
    {
    digitalWrite(ledPins, HIGH);
    delay(120);
    digitalWrite(ledPins, LOW);
    i--;
    }
    }
    /Code*

    I know I cannot use delay as it will, I believe stop all robot functions. I could probably add another battery supply and another Arduino Uno, upload and just run it off the digital ports I already have. But, I would like to learn how to make this code better.
    I can provide the osoyoo code also which is the Obstacle code.
    Thanks,
    Leo_

Have you noticed your code and text turned to italic? that’s because of a
** **[i]** **
being interpreted as a forum formatting command (italic)—> read how to use the forum and how to post code from the posts pinned at the top of the forum and then come back here and edit your post to fix it

the code you have is a full program, to blink leds in your existing robot program indeed means you can’t write it at all this way... read the post about millis() which is anchored at the top of the forum as well