Closed
Description
Describe the bug
The Servo library calls the write()
function within the attach()
function
this->min
and this->max
values Arduino_Core_STM32/libraries/Servo/src/stm32/Servo.cpp
Lines 126 to 127 in 641f3d8
write()
function to work correctly when the servo position is set in degrees. The function write()
uses the this->min
and this->max
values to map the passed value in degrees between min and max https://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 calls
Servo.attach(pin, min, max, value)
- STM32 core version: 2.7.1
The write()
function should either not be called in the attach()
function at all, or it must be called after this->min
and this->max
are configured.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done