I noticed that when I plug in the wires randomly the buttons are all messed up. Does each port go to a button on the controller/joystick? I remember seeing a chart saying which one is which but I’m not exactly sure. I noticed when I plug it in to a certain one it does the joystick, and other buttons. If you guys could help out that would be great. I want to do this without having to program the driver control and have it just work through wires and ports. It is a v5 robot brain.
The ports are coded to specific motors, So if in your code you say your lift motor is in port 1, you would put in in port 1, unless you are using the Vex Clawbot pre installed program, then it is whatever it is setup as. I don’t really understand your question though.
I think it is your port setup in your program that messed it up. Check and make additionak changes to make it match your connected motors in specific ports.
This sounds like you are using the code already made for the clawbot, in which case yes, each motor is assigned to a specific port and controlled by a specific button. But this is simply the code doing this.
On your bot and your own code, your pragma statements (or motor setup, whatever you wanna call it) will assign your motors to ports, but you and your code decide which ones.
There is no rule of “all lift motors go in ports 1-3” or whatever.
Hope that didn’t confuse you more with its convoluted structure.
I didn’t have a program in it actually
Okay thanks, I already know how to code the buttons but I’m not sure how to code the joysticks though
There is a default drive program when you select drive.
Controllername.axisNum.position()
returns a value between -127 and 127
Controllername.axisNum.value()
returns a value between -100 and 100
(someone who knows more about this may say this is backwards. I’m not certain.)
Both return the position of a joystick axis. You can input this directly into motor spin statements.
Notably, arcade uses the whole joystick that it uses and therefore has two axis values. the math to find the arcade value is (axis - axis2) or (axis + axis2) depending on if it is for the left or right drive.