I’m attempting to get the intake on my robot to spin for a length of time, and I need it to run the rest of the program while the intake spins. However, I can’t seem to get it to work. I’m using VEXcode text, fully up-to-date, and the in-program documentation has barely enough info to even use the command.
The command I’m getting the error on is Motor.spinFor(vex::directionType::fwd, 10, vex::timeUnits::sec, false);, and the error is too many arguments.
Motor.spinFor(vex::directionType::fwd, 10, vex::rotationUnits::rev, false); works fine, as does Motor.spinFor(vex::directionType::fwd, 10, vex::timeUnits::sec);, but adding a false to the timeUnits one so that it will run the next line without blocking the program breaks it.
Is there any way to run for a length of time without blocking the program?
I looked through the files and it does not appear you can run spinFor with a false statement at the end if you are using time units. I would suggest using a task instead or turn on the motor, let it run a couple of other actions, then turn off.
You could just say motor.spin(directionType::fwd,100,velocityUnits::pct); That would run for as long as you don’t give a command to the motor. If you don’t want that, you should probably just find out the rotations that you need and put that in for spinFor.