- Notifications
You must be signed in to change notification settings - Fork1k
Closed
Milestone
Description
Describe the bug
The Servo library calls thewrite()
function within theattach()
function
write(value); |
this->min
andthis->max
valuesArduino_Core_STM32/libraries/Servo/src/stm32/Servo.cpp
Lines 126 to 127 in641f3d8
this->min = (MIN_PULSE_WIDTH - min) /4;//resolution of min/max is 4 uS | |
this->max = (MAX_PULSE_WIDTH - max) /4; |
write()
function to work correctly when the servo position is set in degrees. The functionwrite()
uses thethis->min
andthis->max
values to map the passed value in degrees between min and maxhttps://github.com/stm32duino/Arduino_Core_STM32/blob/641f3d8883e9a7220f65dded355dc32e218a990d/libraries/Servo/src/stm32/Servo.cpp#L156/To Reproduce
int min = 40;int max = 70;int value = 40;// on first call to attach, the write is called with a different value in this->min and this->max than on following callsServo.attach(pin, min, max, value)
- STM32 core version: 2.7.1
Thewrite()
function should either not be called in theattach()
function at all, or it must be called afterthis->min
andthis->max
are configured.
Metadata
Metadata
Assignees
Type
Projects
Status
Done