Skip to content

Commit

Permalink
SetServoAngle was returning the wrong value on invalid Register_address
Browse files Browse the repository at this point in the history
SetServoAngle was returning the wrong value on invalid Register_address
  • Loading branch information
Tinyu-Zhao authored Jun 6, 2024
2 parents 62e3f7c + e9533af commit 825ddb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/ATOM_BASE/ATOM_Motion/AtomMotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ uint8_t AtomMotion::ReadBytes(uint8_t address, uint8_t subAddress,

uint8_t AtomMotion::SetServoAngle(uint8_t Servo_CH, uint8_t angle) {
uint8_t Register_address = Servo_CH - 1;
if (Register_address > 3) return 0;
if (Register_address > 3) return 1;
Write1Byte(SERVO_ADDRESS, Register_address, angle);
return 0;
}
Expand Down

0 comments on commit 825ddb2

Please sign in to comment.