Skip to content

🐛[BUG] - motor .get_direction() does not work #695

@ssejrog

Description

@ssejrog

Describe the bug
This outputs 2147483647

To Reproduce
Steps to reproduce the behavior:
The example project uses motor = 127 instead of motor.move(), so with that this is the example code.

void opcontrol() {
  pros::MotorGroup mg({1, 3});
  pros::Controller master(E_CONTROLLER_MASTER);
  while (true) {
    mg.move(master.get_analog(E_CONTROLLER_ANALOG_LEFT_Y));
    // Print the motor direction for the motor at index 1. (port 3)
    std::cout << "Motor Direction: " << mg.get_direction();
    pros::delay(2);
  }
}

Expected behavior
Because the motor isn't reversed, I should see 1.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS, Windows, Linux]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions