Help translating from JAR to EZ Template

Aloha!

One of our teams are in the process of changing over to EZ Template from JAR and would like some help with translating a few things. Here is an example of one of a few things:

if(controller(primary).ButtonY.pressing()){
while (!(LeftArm.position(degrees) <-48)){
RightArm.spin(forward,to_volt(100),volt);
LeftArm.spin(forward,to_volt(100),volt);
}
Intake.spin(reverse,to_volt(100),volt);
Conveyor.spin(forward,to_volt(100),volt);
}
else{
Intake.stop(brakeType::coast);
Conveyor.stop(brakeType::coast);
RightArm.stop(brakeType::hold);
LeftArm.stop(brakeType::hold);

This was what we had in JAR, but using get_position is not working when we try it.

We are still learning PROS and are having a few difficulties - we will likely post more in this thread as time goes by. Thank you!

Assuming that LeftArm is of the Motor class, according to the PROS 4 Documentation on Motors, the get_position method should not have any parameters.

Example given in Docs:

void opcontrol() {
  pros::Motor motor (1);
  pros::Controller master (E_CONTROLLER_MASTER);
  while (true) {
    motor = master.get_analog(E_CONTROLLER_ANALOG_LEFT_Y);
    std::cout << "Motor Position: " << motor.get_position();
    pros::delay(2);
  }
}

Additionally, what kind of issues are you seeing with using get_position() in PROS? Is it not compiling, or not returning the right result, etc.

1 Like