Is the programming linear ?

Is the programming linear or can I have several things going at once. I am trying to have my car move forward and have the servo rotate at the same time. Is this possible? Can anyone point me in the right direction, an example would be good.

The programming is single-threaded, but it can turn on a motor, then go do something else while the motor is still running.

If you need something to be doing multiple things at once, avoid using delay() for delays, since that blocks until the delay is over - see blink without delay example, or the other threads in here about that (the most frequently asked arduino programming question)

The demo several things at a time illustrates how to do … well, you can guess.

…R

Answering your question requires to know about these things you want to do at the same time. Say for example that you want to move two servos at the same time, each servo commanded with a potentiometer. You can write:

void loop() 
{ 
  val1 = analogRead(potpin1);            // reads the value of the potentiometer (value between 0 and 1023) 
  val1 = map(val1, 0, 1023, 0, 180);     // scale it to use it with the servo (value between 0 and 180) 
  myservo1.write(val1);                  // sets the servo position according to the scaled value 

  val2 = analogRead(potpin2);            // reads the value of the potentiometer (value between 0 and 1023) 
  val2 = map(val2, 0, 1023, 0, 180);     // scale it to use it with the servo (value between 0 and 180) 
  myservo2.write(val2);                  // sets the servo position according to the scaled value 

  delay(15);                           // waits for the servo to get there 
}

More complex programming can eventually be needed, depending on what you actually want to do.

Thanks for the information. I need to do a lot more reading…lol