From e9533afef99dedb2b444fa6cf4b4240bfbfeca0d Mon Sep 17 00:00:00 2001 From: Adam Howell Date: Wed, 24 Jan 2024 12:54:50 -0700 Subject: [PATCH] SetServoAngle was returning the wrong value on invalid Register_address When Servo_CH is greater than 4 (Register_address is greater than 3), the return value will now be 1 instead of 0. --- examples/ATOM_BASE/ATOM_Motion/AtomMotion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ATOM_BASE/ATOM_Motion/AtomMotion.cpp b/examples/ATOM_BASE/ATOM_Motion/AtomMotion.cpp index 14dee94..59d0aa7 100644 --- a/examples/ATOM_BASE/ATOM_Motion/AtomMotion.cpp +++ b/examples/ATOM_BASE/ATOM_Motion/AtomMotion.cpp @@ -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; }