Hi, I’m quite confused about the reason why we are not able to use motors that Drivetrain uses.
I want to use Drivetrain for my wheels when the Robot automatically moves during the autonomous period.
Then, when the autonomous period ends, I want to control the wheels with the controller (preferably joystick)
However, when I try to program the robot via VEXcode Text, I cannot select the wheel motors because the Drivetrain was already using the two ports for the wheels.
This means I cannot control the wheels with the controller when the Drivetrain is using the ports or vice versa. Am I understanding Drivetrain the wrong way? Help!
What do you mean ‘select the motors’? The autonomous and usercontrol is sepersted into different functions and cannot run at the same time so they shouldn’t interfere with each other.
The drivetrain piece in vexCode only allows for two ports to be added. If you have more that that, just tell the motors to spin for your auton and control them with joystick code in driver control. Are you using the competition template?
That program for setting up a two motor drivetrain is what builds your pragma statements, so it assigns the drivetrain to your ports. It’s a shortcut, and I suggest simply setting up two separate motors in your pragma statements. It’s easier to program in the long run.
The setup of your robot (pragma statements) stays the same throughout the program. It sounds like you are trying to control those motors induvidually in driver control, which the code doesn’t like because you set up a drivetrain, not the individual motors, in the pragma statements. There should be functions to control the drivetrain by remote, but again, just set up and program two individual motors for your robot.
I have had to deal with this issue as well. If you declare a drivetrain, in my case using VEXcode V5 Text, you cannot control or address the motors individually, only as part of the drivetrain. What I ended up doing is rewriting my program with functions to call the individual motors.
So what you’re saying is it is to program with functions to the individual motors instead of using Drivetrain in Vexcode Text right? Is it still possible to use the robot autonomously as accurate as Drivetrain can?
Yes, though it may require a bit more typing, you have (from my limited experience) more control over your drive by using separate motors. Also I prefer it simply because old habits die hard and I usually use more than two motors on my base anyway. And the drivetrain uses no more sensors than are already in the V5 smart motor, so in theory, the only advantage of Drivetrain is quicker typing. Great for clawbots