So my team is having trouble trying to figure out how to make the wheels turn.
Once we get done with getting the with getting the turning done. We can move on to the next thing
Here is the code:
Also rotateLeft() function we have not started on yet so after we get done with rotateRight() we are going to work on rotateLeft()
you are trying to make the motor move with two different speeds at the same time, because each time the loop runs, it runs movement() then immediately runs either rotateRight() or rotateLeft() depending on where axis 1 is. you should be able to turn with just movement(), try deleting or commenting out the if else if statement and see if the code does what you want it to do,
somthing else to watch out for, if you run any of the turns without running the movement one, because you only assign a new speed to two of the four motors, the other motors keep the speed they had last with movement(), which i would assume is an undesired result
edit: you also might want to check your math for movement(), it looks like atleast the last axis math is wrong if that is meant to turn it. here is a really good resource on the math and programming of an xdrive its not in VexCode V5, so dont just copy his code, i would focus more on the math and explanation in the video
Could you tell me where I went wrong with my math?
im not sure how much of it is wrong, but i know that if you want to turn (axis 1 for you) you need both right side going the same way, and both left side going the same way as eachother, but opposite to the right side. right now you have the top two spinning the same way, and the bottom two spinning the same way but opposite to the top
I fixed the code and it turns and moves around
It just won’t strafe but thats fine.
It should be able to strafe, I would double check the math if I were you