Hello, I would like to code an arcade drive (I believe that’s what its called), with the left joystick as forward and backward, but no matter what I change the code in the driver control, it is stuck in some weird tank drive. Also, when I try to code my intake in driver control, nothing happens. Can anyone help please?
void opcontrol() {
// controller
// loop to continuously update motors
while (true) {
// get joystick positions
int leftY = controller.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_Y);
int rightX = controller.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_Y);
chassis.tank(leftY,rightX);
}
if(controller.get_digital(pros::E_CONTROLLER_DIGITAL_R1))
LowIntake.move(127);
HighIntake.move(127);
if(controller.get_digital(pros::E_CONTROLLER_DIGITAL_R2))
LowIntake.move(127);
HighIntake.move(127);
pros::delay(10);
}
To build experience I would recommend using VexCode blocks to get started. Simply use the config to design your own arcade drive for a chassis. https://codev5.vex.com/
Start a new project or look at the available examples under the file menu.
Build your configuration under the devices on the right.
Now you can review the code that was generated, learn from it, and apply it to your own projects. It will give you a much better understanding. The other option would be to paste all of the code into ChatGPT and have it explain how the code works. The important thing is for you to learn and understand - don’t have AI code it because it will leave you in a bad spot if you don’t understand it yourself.
Yeah, I used block code first, but it was hard because our school has a new starting up program, so there is no one to look at/learn from. I wanted to try to implement PID and ODOM, like the top teams, but didn’t know how, so I jumped from Blockcode to Pros. Maybe I should have done what you have here