The controls on the joystick work just fine with the regular Drive mode, but the issue happens when I try to run a file.
If I don’t add a controller and I only add just the drivetrain, the joysticks will just not move at all. However, when I do add a controller and set it to Left Arcade for example, it will only ever move forward no matter what direction I point the joystick in. I’ve remade new files and redone the code many times but it still does not work.
I was under the impression that I wouldn’t have to, but does this mean I have to code for each joystick? In that case, how would I be able to do that?
It is worth mentioning that I am completely new to VEX and robotics this year and am still unfamiliar with the programs.
Welcome to the forums @aiko!
I think the best way to look into this one is if you could upload your VEXcode V5 file here so that we can take a look at the configuration and see what is going on.
You need to code it so when the joystick goes forward, the motors will turn. that code is just setting how fast it is. (Also does not need to be in a forever loop)
I saw in tutorials that if you use this setting, you don’t need to code any blocks for that, how would I code it so I can use the left joystick for the left side and vice versa like the default controls on Drive?
The issue here is there is a conflict between what your controller is telling the drivetrain to do, and what the block code is telling it to do.
When you move your controller joysticks, they send a velocity value from 0 to 100% to the drivetrain. You can actually think of it as -100% (full reverse) to zero (stop) to +100% full forwards, and everything in between.
So you move the joystick to lets say -50% so the robot should go backwards, but then your block code instantly says “no no, you will go to 50%”
So in this case, for the drivetrain, you do not need any blocks for velocity at all. The controller will handle that for you.
When you are using the digital buttons on the controller, that is different. Digital buttons just tell the motor to spin, but not how fast. It is set to 50% by default, but your code can set a motor velocity for a motor controlled by a digital button (e.g. motor 20 in your example) and next time you press the button, it will spin at that speed.
I use text, but this is basically what I was getting at. (other than the elses) but it’s the same idea. You register the button (in this case the joysticks) and then code what they do.
That is a whole world of conflict, assuming the if/else code is in a loop. If it isn’t it won’t really do anything.
If it is, it’ll give some interesting results. Most of the time, the controller configured mode will win the conflict, but the buttons would have some undesired behaviours.
The code as written there will do next to nothing since the if statements are only evaluated once taking a small fraction of a second, and then never again, giving the appearance of nothing ever happening. Of course, the controller configuration stuff will work just fine and the robot will drive.
But let’s not derail this thread any further and leave it for the OP’s issue.