got motor running

This commit is contained in:
Leonetienne
2025-12-14 18:57:28 +01:00
parent d339f5b297
commit bd906add53
14 changed files with 123 additions and 78 deletions
+5 -4
View File
@@ -15,12 +15,13 @@ class AdafruitServoMotor : public RangedMotor
const float minSafeAngle,
const float maxSafeAngle,
const float specRangeDeg, // 180 for a 180-deg-servo, 270 for a 270-deg-servo, etc ...
const float initialPosition = 0,
const uint16_t minPulseLength = 125,
const uint16_t maxPulseLength = 125,
const float initialPosition = 0
const uint16_t maxPulseLength = 625
) noexcept;
// Returns true if the motion is accepted, false if it is outside of safe bounds.
// If out of safe bounds, maximum or minimun safe value will be assumen
bool moveTo(const float target) noexcept override;
float getPosition() const noexcept override { return hardwareAngleToVirtualAngle(currentHardwarePosition); };
@@ -34,6 +35,6 @@ class AdafruitServoMotor : public RangedMotor
float currentHardwarePosition = 0;
float lastCommittedHardwarePosition = 0;
float specRangeDeg;
const uint8_t minPulseLength;
const uint8_t maxPulseLength;
const uint16_t minPulseLength;
const uint16_t maxPulseLength;
};