Seting motor velocity

Is there a way for me to add an idler motor? so that when I start the code the motor will just be on without pushing a button and if so how can I set the exact speed of the motor? Any help you can give is welcome and appreciated.

Assuming you are going to write your own code and not using default program that comes with V5 brain and, also, assuming that you need this for VRC competition.

Then you would need to put motor.spin() command into the UserControl() function see V5 API reference:

For example:

void UserControl()
  // start motor1
  motor1.spin(directionType::fwd, 50, velocityUnits::rpm);

     if( buttonN.pressing() ) // do something...

     // more user control stuff...