Code Monkey home page Code Monkey logo

esp32servo's Introduction

Servo Library for ESP32

This library attempts to faithfully replicate the semantics of the Arduino Servo library (see http://www.arduino.cc/en/Reference/Servo) for the ESP32, with two (optional) additions. The two new functions expose the ability of the ESP32 PWM timers to vary timer width.

Documentation by Doxygen

ESP32Servo Doxygen

License

Copyright (c) 2017 John K. Bennett. All right reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Library Description:

    Servo - Class for manipulating servo motors connected to ESP32 pins.
    
    int attach(pin )  - Attaches the given GPIO pin to the next free channel
        (channels that have previously been detached are used first), 
        returns channel number or 0 if failure. All pin numbers are allowed,
        but only pins 2,4,12-19,21-23,25-27,32-33 are recommended.
    
    int attach(pin, min, max  ) - Attaches to a pin setting min and max 
        values in microseconds; enforced minimum min is 500, enforced max
        is 2500. Other semantics are the same as attach().
    
    void write () - Sets the servo angle in degrees; a value below 500 is
        treated as a value in degrees (0 to 180). These limit are enforced,
        i.e., values are constrained as follows:
            Value                                   Becomes
            -----                                   -------
            < 0                                        0
            0 - 180                                  value (treated as degrees)
            181 - 499                                 180
            500 - (min-1)                             min
            min-max (from attach or default)         value (treated as microseconds)
            (max+1) - 2500                            max
    
    void writeMicroseconds() - Sets the servo pulse width in microseconds.
        min and max are enforced (see above). 
        
    int read() - Gets the last written servo pulse width as an angle between 0 and 180. 
    
    int readMicroseconds()   - Gets the last written servo pulse width in microseconds.
    
    bool attached() - Returns true if this servo instance is attached to a pin.
    
    void detach() - Stops an the attached servo, frees the attached pin, and frees
        its channel for reuse.  

New ESP32-specific functions

    setTimerWidth(value) - Sets the PWM timer width (must be 16-20) (ESP32 ONLY);
        as a side effect, the pulse width is recomputed.

    int readTimerWidth() - Gets the PWM timer width (ESP32 ONLY) 

Useful Defaults:

default min pulse width for attach(): 544us

default max pulse width for attach(): 2400us

default timer width 16 (if timer width is not set)

default pulse width 1500us (servos are initialized with this value)

MINIMUM pulse with: 500us

MAXIMUM pulse with: 2500us

MAXIMUM number of servos: 16 (this is the number of PWM channels in the ESP32)

esp32servo's People

Contributors

amanenk avatar candorgander avatar codingcatgirl avatar federicobusero avatar jkb-git avatar joesc avatar keionbis avatar loicreboursiere avatar madhephaestus avatar mathix420 avatar mishafarms avatar norhairil avatar soundstorm avatar waynekeenan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32servo's Issues

PWM generated by library does not match real measured PWM in certain cases

I am seeing an issue where the PWM generated does not tally with the PWM measured.

This issue occurs when there is a small delay between 2 calls to writeMicroseconds(), The second call is ignored in this case.

  myservo.writeMicroseconds(1900); //<============ This is the PWM which is seen at the end
  delay(30);
  myservo.writeMicroseconds(1500); //<=============== Ignored, does not have any impact

Sample code to reproduce issue on ESP32 Devkit V1:

#include <ESP32Servo.h>

Servo myservo; 

int servoPin = 13;

int PWM_PIN = 14;
int pwm_value; //Connected to servoPin by wire

#define DELAY_BETWEEN_PWM_CHANGE 30

void setup() {
	// Allow allocation of all timers
	ESP32PWM::allocateTimer(0);
	ESP32PWM::allocateTimer(1);
	ESP32PWM::allocateTimer(2);
	ESP32PWM::allocateTimer(3);
        Serial.begin(115200);
	myservo.setPeriodHertz(50);     
	myservo.attach(servoPin);  
        pinMode(PWM_PIN, INPUT); //Connected to servoPin by wire
}

void loop() {

  delay(1500);
  myservo.writeMicroseconds(1500);
  delay(1000);
  Serial.println("Writing 1900");
  myservo.writeMicroseconds(1900);
  delay(DELAY_BETWEEN_PWM_CHANGE);
  myservo.writeMicroseconds(1500);
  Serial.println("Writing 1500");
  Serial.println("readMicroseconds():"+String(myservo.readMicroseconds()));
  delay(1000);
  pwm_value = pulseIn(PWM_PIN, HIGH);
  Serial.println("PWM measured from pin: "+String(pwm_value));
  Serial.println("==================================================");


  delay(1500);
  myservo.writeMicroseconds(1500);
  delay(1000);
  Serial.println("Writing 1100");
  myservo.writeMicroseconds(1100);
  delay(DELAY_BETWEEN_PWM_CHANGE);
  myservo.writeMicroseconds(1500);
  Serial.println("Writing 1500");
  Serial.println("readMicroseconds():"+String(myservo.readMicroseconds()));
  delay(1000);
  pwm_value = pulseIn(PWM_PIN, HIGH);
  Serial.println("PWM measured from pin: "+String(pwm_value));
  Serial.println("==================================================");
}

Results from above example:

    Writing 1100
    Writing 1500
    readMicroseconds():1499
    PWM measured from pin: 1099
    ==================================================
    Writing 1900
    Writing 1500
    readMicroseconds():1499
    PWM measured from pin: 1899
    ==================================================
    Writing 1100
    Writing 1500
    readMicroseconds():1499
    PWM measured from pin: 1099
    ==================================================
    Writing 1900
    Writing 1500
    readMicroseconds():1499
    PWM measured from pin: 1899
    ==================================================

Unable to compile example sketch (3.x.x)

On any of the example sketches I am receiving an error.

In file included from /Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.h:10,
from /Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.h:68,
from /Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:53:
/Users/maxwell.monson/Library/Arduino15/packages/esp32/hardware/esp32/3.0.0-alpha3/cores/esp32/esp32-hal-ledc.h:42:5: error: 'SemaphoreHandle_t' does not name a type; did you mean 'xSemaphoreHandle'?
42 | SemaphoreHandle_t lock; //xSemaphoreCreateBinary
| ^~~~~~~~~~~~~~~~~
| xSemaphoreHandle
In file included from /Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.h:10,
from /Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:8:
/Users/maxwell.monson/Library/Arduino15/packages/esp32/hardware/esp32/3.0.0-alpha3/cores/esp32/esp32-hal-ledc.h:42:5: error: 'SemaphoreHandle_t' does not name a type; did you mean 'xSemaphoreHandle'?
42 | SemaphoreHandle_t lock; //xSemaphoreCreateBinary
| ^~~~~~~~~~~~~~~~~
| xSemaphoreHandle
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp: In destructor 'virtual ESP32PWM::~ESP32PWM()':
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:50:17: error: 'ledcDetachPin' was not declared in this scope; did you mean 'ledcDetach'?
50 | ledcDetachPin(pin);
| ^~~~~~~~~~~~~
| ledcDetach
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp: In static member function 'static double ESP32PWM::_ledcSetupTimerFreq(uint8_t, double, uint8_t)':
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:57:16: error: 'ledcSetup' was not declared in this scope
57 | return ledcSetup(chan, freq, bit_num);
| ^~~~~~~~~
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp: In member function 'double ESP32PWM::setup(double, uint8_t)':
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:148:17: error: 'ledcDetachPin' was not declared in this scope; did you mean 'ledcDetach'?
148 | ledcDetachPin(pin);
| ^~~~~~~~~~~~~
| ledcDetach
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:149:30: error: 'ledcSetup' was not declared in this scope
149 | double val = ledcSetup(getChannel(), freq, resolution_bits);
| ^~~~~~~~~
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:153:16: error: 'ledcSetup' was not declared in this scope
153 | return ledcSetup(getChannel(), freq, resolution_bits);
| ^~~~~~~~~
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp: In member function 'void ESP32PWM::adjustFrequencyLocal(double, double)':
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:170:17: error: 'ledcDetachPin' was not declared in this scope; did you mean 'ledcDetach'?
170 | ledcDetachPin(pin);
| ^~~~~~~~~~~~~
| ledcDetach
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:174:17: error: 'ledcAttachPin' was not declared in this scope; did you mean 'ledcAttach'?
174 | ledcAttachPin(pin, getChannel()); // re-attach the pin after frequency adjust
| ^~~~~~~~~~~~~
| ledcAttach
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp: In member function 'void ESP32PWM::attachPin(uint8_t)':
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:235:17: error: 'ledcAttachPin' was not declared in this scope; did you mean 'ledcAttach'?
235 | ledcAttachPin(pin, getChannel());
| ^~~~~~~~~~~~~
| ledcAttach
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp: In member function 'void ESP32PWM::detachPin(int)':
/Users/maxwell.monson/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:263:9: error: 'ledcDetachPin' was not declared in this scope; did you mean 'ledcDetach'?
263 | ledcDetachPin(pin);
| ^~~~~~~~~~~~~
| ledcDetach

How to test servos that have 12 bit resolution

From what I understand about this library, the only values that can be sent to the servo are integers representing either a position in degrees or a value in microseconds. A servo with 12 bit resolution needs to receive 4096 values of pulse width within the range of ~900-2200 microseconds in order to achieve this level of resolution.
I am struggling to see how I can test the 12 bit resolution servos if I cannot send fractional values of degrees or microseconds. Am I missing something here?

.write sometimes won't work

I'm working on an engine controller. A servo controls the throttle plate.
It works pretty well with only one exception:
Sometimes when doing a ''blip'' (opening up the plate for 100ms) it just won't do it. It's random, sometimes it works, sometimes it doesn't.
A workaround for that is to detach and immediately reattach the servo before doing the blip.
Do you have an idea why it might do that?

The servo related code snippets:
`// Servo Init

ESP32PWM::allocateTimer(0);
ESP32PWM::allocateTimer(1);
ESP32PWM::allocateTimer(2);
ESP32PWM::allocateTimer(3);
throttleServo.setPeriodHertz(330);
if(throttleServo.attach(servoPinThrottle, 900, 2100)){
Serial.println("ThrottleServo attached successfully");
} else {
Serial.println("No connection to ThrottleServo, this is BAD");
Serial.println("Engine can't start, ignition is cut!");
digitalWrite(ignitionCutRelaisPin, HIGH);
Serial.println("Infinite loop starting now...");
for(;;);
}
throttleServo.write(servoMinDegree);
delay(5);`

`void handleThrottleServo(){ // Get's called every time in Loop

switch(throttleMode){
case 1: // Low Power Linear Mode
servoMapOben = servoMaxDegree + 40;
break;
case 2: // Mid Power Linear Mode
servoMapOben = servoMaxDegree + 20;
break;
case 3: // High Power Linear Mode
servoMapOben = servoMaxDegree;
break;
}
if(waterTempAfterIntercooler < coolantTempSetValue){ // Wenn Kühlmitteltemperatur unter 30 Grad Leerlaufdrehzahl erhöhen
servoMapUnten = servoMinDegree - 15; // Muss später getestet werden und eventuell etwas höher gesetzt werden
} else {
servoMapUnten = servoMinDegree;
}
servoDegree = map(smoothedPotValue, linearPotLowValue, linearPotHighValue, servoMapUnten, servoMapOben);
if(launchControlActive){
int8_t rpmDif = drehzahlSpeedRaw - drehzahlFront; // Die zwei werden nie genau gleich sein, ein Fehlerbereich muss vernachlässigt werden dürfen. Wie hoch? Die 0 muss später angepasst werden. Lenkwinkel notwendig?
if(rpmDif > 10){ // Wenn rpmDif größer Null ist dann dreht die Hinterachse durch
lcVal--;
} else if(rpmDif <= -11){
lcVal = 0;
}
servoDegree =+ lcVal;
}
throttleServo.write(servoDegree);
}`

`void throttleBlipFunction(){ // Get's called every time I'm trying to downshift

if(!throttleBlipActive){
throttleServo.detach();
throttleServo.attach(servoPinThrottle, 900, 2100);
throttleServo.write(servoMaxDegree);
//Serial.println("Throttle Blip aktiv");
switch(gear){ // Zeiten später nach Tests anpassen
case 2:
timeDelayThrottleBlip = 200;
break;
case 3:
timeDelayThrottleBlip = 180;
break;
case 4:
timeDelayThrottleBlip = 160;
break;
case 5:
timeDelayThrottleBlip = 140;
break;
case 6:
timeDelayThrottleBlip = 120;
break;
}
startTimeThrottleBlip = millis();
throttleBlipActive = true;
} else if(millis() >= startTimeThrottleBlip + timeDelayThrottleBlip){
throttleBlipActive = false;
}
}`

ToneExample not working

I'm trying to use the tone() function provided by ESP32Servo. But when running ToneExample, I see no output. The pin is always at low state.

  • I tried this on two ESP32s, one is an ESP32+OLED module.
  • The classic Arduino Blink example does make the pin go high and low.
  • The PWMExample does work on the same pin, i.e. there are PWM changes.

pwm.adjustFrequency needs to be written twice to change the freq.

#include <Arduino.h>
#include <ESP32Encoder.h>
#include <ESP32Servo.h>
int APin = 13;
ESP32PWM pwm;
int freq = 1000;

ESP32Encoder encoder;
ESP32Encoder encoder2;

// timer and flag for example, not needed for encoders
unsigned long encoder2lastToggled;
bool encoder2Paused = false;

void setup(){

// Allow allocation of all timers
ESP32PWM::allocateTimer(0);
ESP32PWM::allocateTimer(1);
ESP32PWM::allocateTimer(2);
ESP32PWM::allocateTimer(3);
pwm.attachPin(APin, freq, 10); // 1KHz 8 bit

Serial.begin(115200);
// Enable the weak pull down resistors

//ESP32Encoder::useInternalWeakPullResistors=DOWN;
// Enable the weak pull up resistors
ESP32Encoder::useInternalWeakPullResistors=UP;

// use pin 19 and 18 for the first encoder
encoder.attachHalfQuad(19, 18);
// use pin 17 and 16 for the second encoder
encoder2.attachHalfQuad(17, 16);
	
// set starting count value after attaching
encoder.setCount(37);

// clear the encoder's raw count and set the tracked count to zero
encoder2.clearCount();
Serial.println("Encoder Start = " + String((int32_t)encoder.getCount()));
// set the lastToggle
encoder2lastToggled = millis();

}

void loop(){
// Loop and read the count
Serial.println("Encoder count = " + String((int32_t)encoder.getCount()) + " " + String((int32_t)encoder2.getCount()));
delay(100);

// every 5 seconds toggle encoder 2

/*
if (millis() - encoder2lastToggled >= 5000) {
	if(encoder2Paused) {
		Serial.println("Resuming Encoder 2");
		encoder2.resumeCount();
	} else {
		Serial.println("Paused Encoder 2");
		encoder2.pauseCount();
	}

	encoder2Paused = !encoder2Paused;
	encoder2lastToggled = millis();
}
*/

/* // fade the LED on thisPin from off to brightest:
for (float brightness = 0; brightness <= 0.99; brightness += 0.01)
{
// Write a unit vector value from 0.0 to 1.0
pwm.writeScaled(brightness);
delay(50);
}

*/

// delay(1000);
//  fade the LED on thisPin from brithstest to off:
for (float brightness = 0.0; brightness <= 1; brightness += 0.01)
{
	freq += 10;
	// Adjust the frequency on the fly with a specific brightness
	// Frequency is in herts and duty cycle is a unit vector 0.0 to 1.0
	pwm.adjustFrequency(5, brightness); // update the time base of the PWM
	pwm.adjustFrequency(5, brightness); // update the time base of the PWM
	delay(50);
}

// pause between LEDs:
delay(500);
freq = 10;
// pwm.adjustFrequency(freq, 0.5); // reset the time base

}

Minimum bit width trigerring a "bit width too big (maximum 14)" error with ESP32-C3

When runing the examples of the library with a ESP32-C3-DevKitM1 I ran in the following error :
[ 111][E][esp32-hal-ledc.c:60] ledcSetup(): No more LEDC channels available! (maximum 6) or bit width too big (maximum 14)
Even using setTimerWidth function didn't change anything.

It appeared that the minimum bit width in your library is equal to DEFAULT_TIMER_WIDTH which is 16.
I'm not sure where it comes from. I've seen here and there on the internet when looking at examples of PWM and ESP32 that the ledcSetup function that you rely on can accept bit width lower than 16.

I managed to make your library work with the ESP32-C3-DevKitM1 by doing several modifications :

  • I've added #define MINIMUM_TIMER_WIDTH 8 (it could be a smaller value, but I'm not sure if it makes sense) in ESP32Servo.h
  • in the first if/else of the void Servo::setTimerWidth(int value) function I've changed the valiue 16 by MINIMUM_TIMER_WIDTH
  • in the int Servo::attach(int pin, int min, int max) I've just commented the lines
    this->ticks = DEFAULT_PULSE_WIDTH_TICKS; this->timer_width = DEFAULT_TIMER_WIDTH;
    I'm not exactly sure how to handle those last two lines of code together with the following one (this->timer_width_ticks = pow(2,this->timer_width);) as those lines are already called in the constructor. But the first two would prevent the my modified setTimerWidth() to work.

Modifications are here : 6729cb0
Let me know what you think and if this fix was the correct way to go !

Cheers !

ESP32 S3 Only 4 servo can work at the same time

I have tested many times with version 0.13.0.

When I use ESP32 S3 (ESP32 S3 DevKitC) , if the number of servo is more than 4, the middle servo doesn't work。
I tested 2 ESP32 S3 boards and got the same results .

But When I use another ESP32 board (ESP32 DEVKIT V1), The following 6 servo are all working fine

#define SL1_PIN GPIO_NUM_4  // fine
#define SL2_PIN GPIO_NUM_5   // fine

#define SL3_PIN GPIO_NUM_2   //not work
#define SR1_PIN GPIO_NUM_21  //not work

#define SR2_PIN GPIO_NUM_16  // fine
#define SR3_PIN GPIO_NUM_17  // fine

void CodelabOS::InitServo() {

  CrazyLog::d(kTag, "InitServo");
  s_left_1_.attach(SL1_PIN, 500, 2500);
  s_left_2_.attach(SL2_PIN, 500, 2500);

  s_left_3_.attach(SL3_PIN, 500, 2500);
  s_right_1_.attach(SR1_PIN, 500, 2500);

  s_right_2_.attach(SR2_PIN, 500, 2500);
  s_right_3_.attach(SR3_PIN, 500, 2500);
  delay(2000);
  .....
}

Then
I checked the pin signals with my oscilloscope , the blue channel is SL3_PIN in the code above,PWM is not working.
the yellow channel is the SL1_PIN pin in the above code, it works great.

servo

error: expected primary-expression before ')' token

In file included from /home/khai/Arduino/servo/servo.ino:7:
/home/khai/Arduino/libraries/ServoESP32/src/Servo.h:68:81: error: call to non-'constexpr' function 'const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]'
static const int TIMER_RESOLUTION = std::min(16, SOC_LEDC_TIMER_BIT_WIDE_NUM);
^
/home/khai/Arduino/libraries/ServoESP32/src/Servo.h: In member function 'T ServoTemplate::mapTemplate(T, T, T, T, T) const':
/home/khai/Arduino/libraries/ServoESP32/src/Servo.h:256:28: error: 'is_floating_point_v' is not a member of 'std'
if constexpr (std::is_floating_point_v) {
^~~~~~~~~~~~~~~~~~~
/home/khai/Arduino/libraries/ServoESP32/src/Servo.h:256:28: note: suggested alternative: 'is_floating_point'
if constexpr (std::is_floating_point_v) {
^~~~~~~~~~~~~~~~~~~
is_floating_point
/home/khai/Arduino/libraries/ServoESP32/src/Servo.h:256:49: error: expected primary-expression before '>' token
if constexpr (std::is_floating_point_v) {
^
/home/khai/Arduino/libraries/ServoESP32/src/Servo.h:256:50: error: expected primary-expression before ')' token
if constexpr (std::is_floating_point_v) {
^

exit status 1

Compilation error: exit status 1

support for espidf v5.1

hello , im using espidf v5.1 and after v4.4 there were alot of breaking changes , since youre the only esp32 library which supports servos , i wanted to know if youre working on upgrading to espidf v5.1?

3 or more servos gets crazy

With following code :

`// create four servo objects
Servo servo1;
Servo servo2;
Servo servo3;
// Published values for SG90 servos; adjust if needed
int minUs = 1000;
int maxUs = 2000;

int servo1Pin = 21;
int servo2Pin = 22;
int servo3Pin = 23;

void setup() {

    ESP32PWM::allocateTimer(0);
ESP32PWM::allocateTimer(1);
ESP32PWM::allocateTimer(2);
ESP32PWM::allocateTimer(3);
servo1.setPeriodHertz(50);      // Standard 50hz servo
servo2.setPeriodHertz(50);      // Standard 50hz servo
servo3.setPeriodHertz(50);      // Standard 50hz servo

servo1.attach(servo1Pin, minUs, maxUs);
servo2.attach(servo2Pin, minUs, maxUs);
servo3.attach(servo3Pin, minUs, maxUs);

servo1.writeMicroseconds(1200); delay(1);
servo2.writeMicroseconds(1200); delay(1);
servo3.writeMicroseconds(1200); delay(1);

delay(10000);

servo1.writeMicroseconds(1500); delay(1);
servo2.writeMicroseconds(1500); delay(1);
servo3.writeMicroseconds(1500); delay(1);

delay(10000);

//servo1.writeMicroseconds(1800); delay(1);
servo2.writeMicroseconds(1800); delay(1);
servo3.writeMicroseconds(1800); delay(1);

delay(10000);`
servo gets crazy. I can use 2 of them. Doesn't matter which ones but after I send 3rd request, it push servo to one side and ignore other changes including stop.

ESP32 Wroom32 Dev Kit
compile with Platform.io, library from their storage

Compilation error using 1.1.1 in Arduino IDE 2.2.1 on DOIT DEVKIT v1

I'd just tried to add the library to my current project but it gives me a compilation error.

/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o:(.bss._ZN8ESP32PWM23explicateAllocationModeE+0x0): multiple definition of ESP32PWM::explicateAllocationMode'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:(.bss._ZN8ESP32PWM23explicateAllocationModeE+0x0): first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o:(.bss._ZN8ESP32PWM10timerCountE+0x0): multiple definition of ESP32PWM::timerCount'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:(.bss._ZN8ESP32PWM10timerCountE+0x0): first defined here /Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::allocateTimer(int)':
/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:25: multiple definition of ESP32PWM::allocateTimer(int)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:25: first defined here /Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o:(.data._ZN8ESP32PWM8PWMCountE+0x0): multiple definition of ESP32PWM::PWMCount'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:(.data._ZN8ESP32PWM8PWMCountE+0x0): first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o:(.bss._ZN8ESP32PWM11ChannelUsedE+0x0): multiple definition of ESP32PWM::ChannelUsed'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:(.bss._ZN8ESP32PWM11ChannelUsedE+0x0): first defined here /Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::ESP32PWM()':
/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:36: multiple definition of ESP32PWM::ESP32PWM()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:36: first defined here /Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::ESP32PWM()':
/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:36: multiple definition of ESP32PWM::ESP32PWM()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:36: first defined here /Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::_ledcSetupTimerFreq(unsigned char, double, unsigned char)':
/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:56: multiple definition of ESP32PWM::_ledcSetupTimerFreq(unsigned char, double, unsigned char)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:56: first defined here /Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::timerAndIndexToChannel(int, int)':
/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:61: multiple definition of ESP32PWM::timerAndIndexToChannel(int, int)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:61: first defined here /Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o:(.data._ZN8ESP32PWM12timerFreqSetE+0x0): multiple definition of ESP32PWM::timerFreqSet'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:(.data._ZN8ESP32PWM12timerFreqSetE+0x0): first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::allocatenext(double)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:73: multiple definition of ESP32PWM::allocatenext(double)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:73: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::deallocate()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:120: multiple definition of ESP32PWM::deallocate()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:120: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::~ESP32PWM()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:48: multiple definition of ESP32PWM::~ESP32PWM()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:48: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::~ESP32PWM()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:48: multiple definition of ESP32PWM::~ESP32PWM()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:48: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::~ESP32PWM()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:48: multiple definition of ESP32PWM::~ESP32PWM()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:48: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::getChannel()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:136: multiple definition of ESP32PWM::getChannel()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:136: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::getDutyScaled()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:155: multiple definition of ESP32PWM::getDutyScaled()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:155: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::write(unsigned int)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:162: multiple definition of ESP32PWM::write(unsigned int)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:162: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::writeScaled(double)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:159: multiple definition of ESP32PWM::writeScaled(double)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:159: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::adjustFrequencyLocal(double, double)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:166: multiple definition of ESP32PWM::adjustFrequencyLocal(double, double)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:166: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::adjustFrequency(double, double)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:180: multiple definition of ESP32PWM::adjustFrequency(double, double)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:180: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::writeTone(double)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:194: multiple definition of ESP32PWM::writeTone(double)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:194: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::writeNote(note_t, unsigned char)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:208: multiple definition of ESP32PWM::writeNote(note_t, unsigned char)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:208: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::read()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:221: multiple definition of ESP32PWM::read()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:221: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::readFreq()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:224: multiple definition of ESP32PWM::readFreq()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:224: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::attach(int)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:227: multiple definition of ESP32PWM::attach(int)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:227: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::attachPin(unsigned char)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:231: multiple definition of ESP32PWM::attachPin(unsigned char)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:231: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::detachPin(int)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:262: multiple definition of ESP32PWM::detachPin(int)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:262: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::checkFrequencyForSideEffects(double)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:287: multiple definition of ESP32PWM::checkFrequencyForSideEffects(double)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:287: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::setup(double, unsigned char)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:143: multiple definition of ESP32PWM::setup(double, unsigned char)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:143: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function ESP32PWM::attachPin(unsigned char, double, unsigned char)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:256: multiple definition of ESP32PWM::attachPin(unsigned char, double, unsigned char)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:256: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM.cpp.o: in function pwmFactory(int)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM.cpp:317: multiple definition of pwmFactory(int)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32PWM 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32PWM 2.cpp:317: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::Servo()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:57: multiple definition of Servo::Servo()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:57: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::Servo()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:57: multiple definition of Servo::Servo()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:57: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::getPwm()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:68: multiple definition of Servo::getPwm()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:68: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::attach(int, int, int)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:80: multiple definition of Servo::attach(int, int, int)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:80: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::attach(int)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:74: multiple definition of Servo::attach(int)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:74: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::detach()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:135: multiple definition of Servo::detach()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:135: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::attached()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:204: multiple definition of Servo::attached()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:198: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::setTimerWidth(int)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:209: multiple definition of Servo::setTimerWidth(int)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:203: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::readTimerWidth()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:243: multiple definition of Servo::readTimerWidth()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:237: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::usToTicks(int)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:248: multiple definition of Servo::usToTicks(int)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:242: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::writeMicroseconds(int)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:161: multiple definition of Servo::writeMicroseconds(int)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:161: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::write(int)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:146: multiple definition of Servo::write(int)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:146: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::ticksToUs(int)': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:253: multiple definition of Servo::ticksToUs(int)'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:247: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::readMicroseconds()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:189: multiple definition of Servo::readMicroseconds()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:183: first defined here
/Users/ed/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo.cpp.o: in function Servo::read()': /Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo.cpp:184: multiple definition of Servo::read()'; /private/var/folders/lj/j59j68zj02d1c9t02zkqsxr40000gn/T/arduino/sketches/F9003948BAB8F9EE99F02A36881B09BE/libraries/ESP32Servo/ESP32Servo 2.cpp.o:/Users/ed/Documents/Arduino/libraries/ESP32Servo/src/ESP32Servo 2.cpp:178: first defined here
collect2: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1`

Servo channels not deallocated in destructor

When using Servo objects locally in a function, the used channels are not deallocated in the destructor phase. This results in a lack of channels when running following program.

#include <ESP32Servo.h>
 
#define NUMPINS 18
int pins[NUMPINS] = {2, 4, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33};

void sweep(int pin)
{
  Servo myservo;  // create servo object to control a servo
  int pos;

  myservo.setPeriodHertz(50);    // standard 50 hz servo
  myservo.attach(pin, 1000, 2000);


  for (pos = 0; pos <= 180; pos += 20) { // goes from 0 degrees to 180 degrees
    myservo.write(pos);    // tell servo to go to position in variable 'pos'
    delay(45);             // waits 45ms for the servo to reach the position
  }

  for (pos = 180; pos >= 0; pos -= 20) { // goes from 180 degrees to 0 degrees
    myservo.write(pos);    // tell servo to go to position in variable 'pos'
    delay(45);             // waits 45ms for the servo to reach the position
  }
}

void setup() {
  Serial.begin(115200);
  Serial.println("Servo sweep on all PWM pins");
}

void loop() {
  for (int pincount = 0; pincount < NUMPINS; ++pincount)
  {
    Serial.print("Sweep servo on pin ");
    Serial.println(pins[pincount]);
    sweep(pins[pincount]);
  }
}

Installing ESP32Servo in the ESP32 env, causes espressif8266 env to fail compile

I have a project with two configurations, one for the ESP32 and one for the NodeMCU. The built in 8266 servo library works for that built, but I need to install this library for the ESP32... but when I do, then the NodeMCU config fails to build. I get:


Compiling .pio/build/nodemcuv2/lib874/ESP32Servo/ESP32PWM.cpp.o
In file included from .pio/libdeps/nodemcuv2/ESP32Servo/src/ESP32PWM.cpp:8:0:
.pio/libdeps/nodemcuv2/ESP32Servo/src/ESP32PWM.h:10:28: fatal error: esp32-hal-ledc.h: No such file or directory

************************************************************************
* Looking for esp32-hal-ledc.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp32-hal-ledc.h"
* Web  > https://platformio.org/lib/search?query=header:esp32-hal-ledc.h
*
************************************************************************

 #include "esp32-hal-ledc.h"
                            ^
compilation terminated.
*** [.pio/build/nodemcuv2/lib874/ESP32Servo/ESP32PWM.cpp.o] Error 1

read() does not return last write() accurately

There is a loss of precision when reading back the angle that was last written to the servo. This prevents doing something like this: servo.write(servo.read()+1); to increment a servo by 1 degree from it's current position.

Possible cause is the value being mangled by the (integer) map() macros in the read() & write() functions.

Example test code:

for (int16_t i = 0; i <= 30; i++) {
x_axis.write(i);
Serial.printf("Wrote: %u Read: %u\n", i, x_axis.read());
}

Output:
Wrote: 0 Read: 0
Wrote: 1 Read: 0
Wrote: 2 Read: 1
Wrote: 3 Read: 1
Wrote: 4 Read: 3
Wrote: 5 Read: 3
Wrote: 6 Read: 5
Wrote: 7 Read: 5
Wrote: 8 Read: 7
Wrote: 9 Read: 7
Wrote: 10 Read: 9
Wrote: 11 Read: 10
Wrote: 12 Read: 10
Wrote: 13 Read: 12
Wrote: 14 Read: 12
Wrote: 15 Read: 14
Wrote: 16 Read: 14
Wrote: 17 Read: 16
Wrote: 18 Read: 16
Wrote: 19 Read: 18
Wrote: 20 Read: 18
Wrote: 21 Read: 20
Wrote: 22 Read: 20
Wrote: 23 Read: 22
Wrote: 24 Read: 22
Wrote: 25 Read: 24
Wrote: 26 Read: 24
Wrote: 27 Read: 26
Wrote: 28 Read: 26
Wrote: 29 Read: 28
Wrote: 30 Read: 29

Clearly this is not very useful

Broke build

78ac6fa broke my build.

In file included from c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\vector:60:0,
from .piolibdeps\Esp32SimplePacketComs_ID5766\src/Esp32SimplePacketComs.h:6,
from src\FinalProject.cpp:2:
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:265:56: error: macro "max" passed 3 arguments, but takes just 2
Archiving .pioenvs\esp32dev\lib95e\libESP32Servo_ID4744.amax(const _Tp& __a, const _Tp& __b, _Compare __comp)

^
Archiving .pioenvs\esp32dev\libd70\libPreferences.a
Compiling .pioenvs\esp32dev\lib532\WiiChuck_ID1465\Accessory.cpp.o
Compiling .pioenvs\esp32dev\lib532\WiiChuck_ID1465\Classic.cpp.o
Compiling .pioenvs\esp32dev\lib532\WiiChuck_ID1465\DJTable .cpp.o
In file included from .piolibdeps\ESP32Servo_ID4744\src/analogWrite.h:5:0,
from .piolibdeps\ESP32Servo_ID4744\src/ESP32Servo.h:67,
from src\FinalProject.cpp:1:
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:195:5: error: expected unqualified-id before 'const'
min(const _Tp& __a, const _Tp& __b)
^
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:195:5: error: expected ')' before 'const'
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:195:5: error: expected ')' before 'const'
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:195:5: error: expected initializer before 'const'
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:219:5: error: expected unqualified-id before 'const'
max(const _Tp& __a, const _Tp& __b)
^
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:219:5: error: expected ')' before 'const'
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:219:5: error: expected ')' before 'const'
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:219:5: error: expected initializer before 'const'
In file included from c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\vector:60:0,
from .piolibdeps\Esp32SimplePacketComs_ID5766\src/Esp32SimplePacketComs.h:6,
from src\FinalProject.cpp:2:
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:243:5: error: 'std::min' declared as an 'inline' variable
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:246:7: error: expected primary-expression before 'if'
if (__comp(__b, __a))
^
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:246:7: error: expected '}' before 'if'
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:246:7: error: expected ';' before 'if'
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:248:7: error: expected unqualified-id before 'return'
return __a;
^
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:265:5: error: 'max' declared as an 'inline' variable
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:268:7: error: expected primary-expression before 'if'
if (__comp(__a, __b))
^
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:268:7: error: expected '}' before 'if'
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:268:7: error: expected ';' before 'if'
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:270:7: error: expected unqualified-id before 'return'
return __a;
^
c:\users\austinshalit\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algobase.h:271:5: error: expected declaration before '}' token
}
^
*** [.pioenvs\esp32dev\src\FinalProject.cpp.o] Error 1

Get the output level of servo pin

Hi,
since you did not enable discussions (Settings > Features > Discussions) I have to enter my question as an issue.

I want to solve the problem, that the servo signal goes LOW at the time of detach() see output below.

Is there a way to get the current state of the I/O pin used for servo output.
On AVR platform I can use digitalRead(<pin_number>) but on ESP32, this does not work, it stops the program.

If I connect the pin to another and use the othes as input the program works well and output:

Attach servo at pin 5 and move to 0 -> 180 -> 90 degree
Connect servo out pin 5 to monitoring in pin=18
Each character is 50 microseconds
Move servo to 180 degree, wait 400 ms and then detach 600 microseconds after start of pulse
_------------___________________________________________
Move servo to 180 degree, wait 400 ms and then detach 2500 microseconds after start of pulse
_-----------------------------------____________________

Or is there a way to read out the timer counter value and to decide if it is lower than hpoint, which I can get with
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#_CPPv415ledc_get_hpoint11ledc_mode_t14ledc_channel_t ?

Thanks
ArminJo

Always returning 1 as channel number

Hi,

I am using following code to attach 4 servos. I want to get back the channel number used by the attach command, but this is always 1. Why can't I get the channel number after the call to attach?

#define PIN_TURNOUT_0 16 // PWM Turnout 0
#define PIN_TURNOUT_1 17 // PWM Turnout 1
#define PIN_TURNOUT_2 18 // PWM Turnout 2
#define PIN_TURNOUT_3 19 // PWM Turnout 3

sg90_0.setPeriodHertz(50); // PWM frequency for SG90 #0
sg90_1.setPeriodHertz(50); // PWM frequency for SG90 #1
sg90_2.setPeriodHertz(50); // PWM frequency for SG90 #0
sg90_3.setPeriodHertz(50); // PWM frequency for SG90 #1
int SG0 = sg90_0.attach(PIN_TURNOUT_0, 500, 2400); // Minimum and maximum pulse width (in µs) to go from 0° to 180
Serial.printf("Channel for Servo %d \n", SG0);
int SG1 = sg90_1.attach(PIN_TURNOUT_1, 500, 2400); // Minimum and maximum pulse width (in µs) to go from 0° to 180
Serial.printf("Channel for Servo %d \n", SG1);
int SG2 = sg90_2.attach(PIN_TURNOUT_2, 500, 2400); // Minimum and maximum pulse width (in µs) to go from 0° to 180
Serial.printf("Channel for Servo %d \n", SG2);
int SG3 = sg90_3.attach(PIN_TURNOUT_3, 500, 2400); // Minimum and maximum pulse width (in µs) to go from 0° to 180
Serial.printf("Channel for Servo %d \n", SG3);

Output :
Channel for Servo 1
Channel for Servo 1
Channel for Servo 1
Channel for Servo 1

Disable, or support configurable, Debug output

Generally it's a good practice that libraries shouldn't output debug, unless requested by user/client code or some kind of other logging settings, as it can interfere with the normal operation of a program.

Please could you remove, or make it a runtime flag to enable/disable (default: disabled), all debug output? e.g. I'm seeing this:

PWM on ledc channel #1 using 'timer 0' to freq 50.00Hz

Thanks

Different behavior of pin 25 and 27 with analogWrite

Hello,

first of all I would like to thank you for this great lib.
I am currently working on an implementation of the TPS (in Germany "Tastenprogrammierbare Steuerung, Key Programmable Control"), a very small and limited PLC.
This PLC was originally invented with a small Holtek chip. I've already implemented this in Arduino, ATTiny84, micro: bit, and some other MCUs. Now I am implementing this in ESP32. I'm already done with the main parts because I used the same sources as for the ATMega's and switched to your Lib for analogWrite, Tone and the servo implementation.
The "problem", it's not really a problem, is that GPIOs 25 and 27 (which I used for the DAC outputs) behave differently with analogWrite. 27 uses PWM to generate the output signal, but the 25 uses a real DAC.
As I said, this is not really a problem, but is it possible to switch to PWM at pin 25? Maybe as an additional option?

Buzzing/humming coming from servo

Hi all, I'm trying to port my arduino code to run on esp32. So far so good, and Ive got it working but I've noticed that when a servo is set to between 80 and 100 degrees, it buzzes/hums even after reaching the position. I've experimented with different pulse width ranges but that hasn't helped. The servo is not attached to anything so the gear is unimpeded. I don't get the buzzing on the arduino board. Has anyone come across this before?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.