Closed arpita-agrawal closed 3 years ago
Hi @arpita-agrawal ,
the difference in mbed package is that the callback overhead is much larger (see https://github.com/arduino-libraries/Servo/blob/master/src/mbed/Servo.cpp#L46 against https://github.com/arduino-libraries/Servo/blob/master/src/samd/Servo.cpp#L27 ).
So, when the map()
calculation is performed
https://github.com/arduino-libraries/Servo/blob/a98c543e7dabf8ad4114c748d4370997275ca200/src/mbed/Servo.cpp#L107-L117
the value written can "swing" more than in other architectures.
TRIM_DURATION
value was found empirically, so maybe reducing it doesn't affect performances.
@dcuartielles can we retest it on real hardware with a nano33ble / portenta and check if we can fix it in some way?
@arpita-agrawal I'm closing the issue here since it's not related with mbed
core itself, please reopen in https://github.com/arduino-libraries/Servo
with Mbed 1.1.6
The read method of Servo returns incorrect values. If position 0 is written the read value is -1 and for 180 the returned value is ~ 177- 178.
The issue is not seen with SAM, SAMD, or AVR.
Please use the below sketch for reproducing the issue: