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: https://api.vexcode.cloud/v5/html/classvex_1_1motor.html

For example:

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

  while(1)
  {
     if( buttonN.pressing() ) // do something...

     // more user control stuff...

     vex::task::sleep(20);
  }
}
2 Likes