I have a program which moves the robot, with some macros, however only the Y axis for the right is detected, which is weird because only the X axis was programmed for the right, nothing else works other than 2 motors for both Y axes, despite the right Y never being put the program. When I move it sideways nothing happens. Thanks
#include "main.h"
void opcontrol() {
pros::Controller master(pros::E_CONTROLLER_MASTER);
pros::Motor left_mtr(1);
pros::v5 upload --slot SLOT_2;
pros::Motor right_mtr(10,1);
pros::Motor left_mtr2(9,1);
pros::Motor right_mtr2(2);
pros::Motor tray2(5);
pros::Motor intake_left(5);
pros::Motor intake_right(3,1);
pros::Motor tray(9);
//left and right is viewed from back of robot
while (true) {
int left = master.get_analog(ANALOG_LEFT_Y);
int right = master.get_analog(ANALOG_LEFT_X);
left_mtr.move_velocity((left) + (right));
left_mtr2.move_velocity((left) + (right));
right_mtr.move_velocity((left) - (right));
right_mtr2.move_velocity((left) - (right));
//arcade control
int tray_speed=127;
if(master.get_digital(DIGITAL_R2)) {
tray.move_velocity(tray_speed);
tray_speed -= 1;
pros::delay(50);
//deploying tray system at proportional speed, speed will decrease every 50 MS
}
else if (master.get_digital(DIGITAL_R1)) {
tray_speed = 127;
tray.move_velocity(-127);
pros::delay(50);
//moves tray back at 127 rpm
}
else if(master.get_digital(DIGITAL_Y)){
tray.move_velocity(-60);
pros::delay(50);
//moving tray back at partial speed
}
else if(master.get_digital(DIGITAL_A)){
tray.move_velocity(60);
pros::delay(50);
//deploying tray system at partial speed to prevent cubes from tipping
}
if (master.get_digital(DIGITAL_L1)) {
intake_left.move_velocity(127);
intake_right.move_velocity(127);
//When L1 is pressed intake stops, or is revesed when L1 is held down
}
else if (master.get_digital(DIGITAL_L2)) {
while(master.get_digital(DIGITAL_L1))
{
intake_left.move_velocity(-127);
intake_right.move_velocity(-127);
//intake on/off switch
}
}
pros::delay(20);
}
}