Skip to content

Commit

Permalink
fix isConnected for reversed motors
Browse files Browse the repository at this point in the history
  • Loading branch information
toxicdefender404 committed Jan 30, 2025
1 parent 630a570 commit 7049e3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hardware/Motor/Motor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ BrakeMode Motor::getBrakeMode() const {
}

int32_t Motor::isConnected() const {
return pros::c::get_plugged_type(m_port) == pros::c::v5_device_e_t::E_DEVICE_MOTOR;
return pros::c::get_plugged_type(abs(m_port)) == pros::c::v5_device_e_t::E_DEVICE_MOTOR;
}

Angle Motor::getAngle() const {
Expand Down

0 comments on commit 7049e3e

Please sign in to comment.