Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Servo.h to ESP32ArduinoServo.h #10

Closed
wants to merge 1 commit into from
Closed

Rename Servo.h to ESP32ArduinoServo.h #10

wants to merge 1 commit into from

Conversation

platisd
Copy link

@platisd platisd commented Jan 15, 2020

This will help the library avoid naming clashes with the default Arduino servo library.

Fixes #9

This will help the library avoid naming clashes with the
default Arduino servo library.
@ruiseixasm
Copy link

ruiseixasm commented Jan 15, 2020

Still gives all these errors. This should have be done from the beginning by the author!

Arduino: 1.8.10 (Windows 10), Board: "DOIT ESP32 DEVKIT V1, 80MHz, 921600, None"

WARNING: library Servo claims to run on avr, megaavr, sam, samd, nrf52, stm32f4, mbed architecture(s) and may be incompatible with your current board which runs on esp32 architecture(s).
In file included from C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:33:0:

C:\Users\Utilizador\Documents\Arduino\libraries\Servo\src/Servo.h:77:2: error: #error "This library only supports boards with an AVR, SAM, SAMD, NRF52 or STM32F4 processor."

 #error "This library only supports boards with an AVR, SAM, SAMD, NRF52 or STM32F4 processor."

  ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:35:12: error: 'int Servo::channel_next_free' is not a static data member of 'class Servo'

 int Servo::channel_next_free = 0;

            ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp: In constructor 'Servo::Servo()':

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:38:18: error: '_resetFields' was not declared in this scope

     _resetFields();

                  ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp: At global scope:

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:41:15: error: definition of implicitly-declared 'Servo::~Servo()'

 Servo::~Servo() {

               ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:45:6: error: prototype for 'bool Servo::attach(int, int, int, int, int, int)' does not match any in class 'Servo'

 bool Servo::attach(int pin, int channel, 

      ^

In file included from C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:33:0:

C:\Users\Utilizador\Documents\Arduino\libraries\Servo\src/Servo.h:109:11: error: candidates are: uint8_t Servo::attach(int, int, int)

   uint8_t attach(int pin, int min, int max); // as above but also sets min and max values for writes. 

           ^

In file included from C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:33:0:

C:\Users\Utilizador\Documents\Arduino\libraries\Servo\src/Servo.h:108:11: error:                 uint8_t Servo::attach(int)

   uint8_t attach(int pin);           // attach the given pin to the next free channel, sets pinMode, returns channel number or 0 if failure

           ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:71:6: error: prototype for 'bool Servo::detach()' does not match any in class 'Servo'

 bool Servo::detach() {

      ^

In file included from C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:33:0:

C:\Users\Utilizador\Documents\Arduino\libraries\Servo\src/Servo.h:110:8: error: candidate is: void Servo::detach()

   void detach();

        ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp: In member function 'void Servo::write(int)':

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:84:34: error: '_minAngle' was not declared in this scope

     degrees = constrain(degrees, _minAngle, _maxAngle);

                                  ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:84:45: error: '_maxAngle' was not declared in this scope

     degrees = constrain(degrees, _minAngle, _maxAngle);

                                             ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:84:54: error: 'constrain' was not declared in this scope

     degrees = constrain(degrees, _minAngle, _maxAngle);

                                                      ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:85:41: error: '_angleToUs' was not declared in this scope

     writeMicroseconds(_angleToUs(degrees));

                                         ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp: In member function 'void Servo::writeMicroseconds(int)':

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:92:34: error: '_minPulseWidth' was not declared in this scope

     pulseUs = constrain(pulseUs, _minPulseWidth, _maxPulseWidth);

                                  ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:92:50: error: '_maxPulseWidth' was not declared in this scope

     pulseUs = constrain(pulseUs, _minPulseWidth, _maxPulseWidth);

                                                  ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:92:64: error: 'constrain' was not declared in this scope

     pulseUs = constrain(pulseUs, _minPulseWidth, _maxPulseWidth);

                                                                ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:93:5: error: '_pulseWidthDuty' was not declared in this scope

     _pulseWidthDuty = _usToDuty(pulseUs);

     ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:93:40: error: '_usToDuty' was not declared in this scope

     _pulseWidthDuty = _usToDuty(pulseUs);

                                        ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:94:15: error: '_channel' was not declared in this scope

     ledcWrite(_channel, _pulseWidthDuty);

               ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:94:40: error: 'ledcWrite' was not declared in this scope

     ledcWrite(_channel, _pulseWidthDuty);

                                        ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp: In member function 'int Servo::read()':

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:98:41: error: '_usToAngle' was not declared in this scope

     return _usToAngle(readMicroseconds());

                                         ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp: In member function 'int Servo::readMicroseconds()':

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:105:25: error: '_channel' was not declared in this scope

     int duty = ledcRead(_channel);

                         ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:105:33: error: 'ledcRead' was not declared in this scope

     int duty = ledcRead(_channel);

                                 ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:106:26: error: '_dutyToUs' was not declared in this scope

     return _dutyToUs(duty);

                          ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp: At global scope:

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:109:6: error: prototype for 'bool Servo::attached() const' does not match any in class 'Servo'

 bool Servo::attached() const { return _pin != PIN_NOT_ATTACHED; }

      ^

In file included from C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:33:0:

C:\Users\Utilizador\Documents\Arduino\libraries\Servo\src/Servo.h:115:8: error: candidate is: bool Servo::attached()

   bool attached();                   // return true if this servo is attached, otherwise false 

        ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:111:26: error: no 'int Servo::attachedPin() const' member function declared in class 'Servo'

 int Servo::attachedPin() const { return _pin; }

                          ^

C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master\src\ESP32ArduinoServo.cpp:113:30: error: no 'void Servo::_resetFields()' member function declared in class 'Servo'

 void Servo::_resetFields(void) {

                              ^

Multiple libraries were found for "ESP32ArduinoServo.h"
 Used: C:\Users\Utilizador\Documents\Arduino\libraries\ESP32-Arduino-Servo-Library-master
Multiple libraries were found for "Servo.h"
 Used: C:\Users\Utilizador\Documents\Arduino\libraries\Servo
 Not used: C:\Program
exit status 1
Error compiling for board DOIT ESP32 DEVKIT V1.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

@JarekParal
Copy link
Member

Hi, do you get this error in Arduino IDE? This library was created primarily for PlatformIO and there isn't such warning.

@platisd
Copy link
Author

platisd commented Jan 16, 2020

Hi, do you get this error in Arduino IDE? This library was created primarily for PlatformIO and there isn't such warning.

Yes, Arduino IDE 1.8.10 running on Ubuntu 18.04 👍

@JarekParal
Copy link
Member

Could you please post your program which created this error message? Also, I saw that in the log are Windows paths (e,g. C:\Users\Utilizador\Documents\Arduino\libraries\Servo\src/Servo.h). How you can then use Ubuntu?

@platisd
Copy link
Author

platisd commented Jan 16, 2020

Could you please post your program which created this error message? Also, I saw that in the log are Windows paths (e,g. C:\Users\Utilizador\Documents\Arduino\libraries\Servo\src/Servo.h). How you can then use Ubuntu?

These are logs by @ruiseixasm who's probably using Windows, but I saw the pretty similar ones on my system. You can easily reproduce them by downloading the Arduino IDE, then installing the library, installing the ESP32 boards and finally trying to compile one of the examples.

@platisd
Copy link
Author

platisd commented Jan 28, 2020

This is no longer needed as per Arduino IDE 1.8.11

@platisd platisd closed this Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Naming conflicts with "default" <Servo.h>
3 participants