B4R Question Adafruit PWM_ServoDriver compile issue

Discussion in 'B4R Questions' started by giggetto71, Oct 26, 2019.

  1. giggetto71

    giggetto71 Member Licensed User

    Hi ,
    I have dowloaded the library in subject from this case and copied as usual in the libraries folder of B4R.

    https://www.b4x.com/android/forum/t...for-my-i2c-1-to-16-servo-board.66444/#content


    for some reasons, as soon as I add that library to the project, it won't compile. I am attaching below the a part of the log where it looks like it does not like a min function inside the adafruit library..

    Has anyone used this libe successfully?
    thanks!


    ..........
    C:\Users\105028~1\Desktop\105028~1\Desktop\105028~1\D\B4A_PR~1\B4R\B4R_PR~1\SERVOT~1\Objects\bin\sketch\Adafruit_PWMServoDriver.cpp: In member function 'void Adafruit_PWMServoDriver::setPin(uint8_t, uint16_t, bool)':
    Adafruit_PWMServoDriver.cpp:89:22: error: no matching function for call to 'min(uint16_t&, int)'
    val = min(val, 4095);
    ^
    C:\Users\105028~1\Desktop\105028~1\Desktop\105028~1\D\B4A_PR~1\B4R\B4R_PR~1\SERVOT~1\Objects\bin\sketch\Adafruit_PWMServoDriver.cpp:89:22: note: candidates are:
    In file included from c:\users\105028248.logon\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\algorithm:62:0,
    from C:\Users\105028248.LOGON\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266/Arduino.h:257,
    from C:\Users\105028~1\Desktop\105028~1\Desktop\105028~1\D\B4A_PR~1\B4R\B4R_PR~1\SERVOT~1\Objects\bin\sketch\Adafruit_PWMServoDriver.h:22,
    from C:\Users\105028~1\Desktop\105028~1\Desktop\105028~1\D\B4A_PR~1\B4R\B4R_PR~1\SERVOT~1\Objects\bin\sketch\Adafruit_PWMServoDriver.cpp:18:
    c:\users\105028248.logon\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algo.h:4226:5: note: template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)
    min(initializer_list<_Tp> __l, _Compare __comp)
    ^
    c:\users\105028248.logon\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algo.h:4226:5: note: template argument deduction/substitution failed:
    C:\Users\105028~1\Desktop\105028~1\Desktop\105028~1\D\B4A_PR~1\B4R\B4R_PR~1\SERVOT~1\Objects\bin\sketch\Adafruit_PWMServoDriver.cpp:89:22: note: mismatched types 'std::initializer_list<_Tp>' and 'short unsigned int'
    val = min(val, 4095);
    ^
    In file included from c:\users\105028248.logon\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\algorithm:62:0,
    from C:\Users\105028248.LOGON\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266/Arduino.h:257,
    from C:\Users\105028~1\Desktop\105028~1\Desktop\105028~1\D\B4A_PR~1\B4R\B4R_PR~1\SERVOT~1\Objects\bin\sketch\Adafruit_PWMServoDriver.h:22,
    from C:\Users\105028~1\Desktop\105028~1\Desktop\105028~1\D\B4A_PR~1\B4R\B4R_PR~1\SERVOT~1\Objects\bin\sketch\Adafruit_PWMServoDriver.cpp:18:
    c:\users\105028248.logon\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algo.h:4221:5: note: template<class _Tp> _Tp std::min(std::initializer_list<_Tp>)
    min(initializer_list<_Tp> __l)
    ^
    c:\users\105028248.logon\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algo.h:4221:5: note: template argument deduction/substitution failed:
    C:\Users\105028~1\Desktop\105028~1\Desktop\105028~1\D\B4A_PR~1\B4R\B4R_PR~1\SERVOT~1\Objects\bin\sketch\Adafruit_PWMServoDriver.cpp:89:22: note: mismatched types 'std::initializer_list<_Tp>' and 'short unsigned int'
    val = min(val, 4095);
    ^
    In file included from c:\users\105028248.logon\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\algorithm:61:0,
    from C:\Users\105028248.LOGON\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266/Arduino.h:257,
    from C:\Users\105028~1\Desktop\105028~1\Desktop\105028~1\D\B4A_PR~1\B4R\B4R_PR~1\SERVOT~1\Objects\bin\sketch\Adafruit_PWMServoDriver.h:22,
    from C:\Users\105028~1\Desktop\105028~1\Desktop\105028~1\D\B4A_PR~1\B4R\B4R_PR~1\SERVOT~1\Objects\bin\sketch\Adafruit_PWMServoDriver.cpp:18:
    c:\users\105028248.logon\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
    min(const _Tp& __a, const _Tp& __b, _Compare __comp)
    ^
    c:\users\105028248.logon\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algobase.h:239:5: note: template argument deduction/substitution failed:
    C:\Users\105028~1\Desktop\105028~1\Desktop\105028~1\D\B4A_PR~1\B4R\B4R_PR~1\SERVOT~1\Objects\bin\sketch\Adafruit_PWMServoDriver.cpp:89:22: note: deduced conflicting types for parameter 'const _Tp' ('short unsigned int' and 'int')
    val = min(val, 4095);
    ^
    In file included from c:\users\105028248.logon\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\algorithm:61:0,
    from C:\Users\105028248.LOGON\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266/Arduino.h:257,
    from C:\Users\105028~1\Desktop\105028~1\Desktop\105028~1\D\B4A_PR~1\B4R\B4R_PR~1\SERVOT~1\Objects\bin\sketch\Adafruit_PWMServoDriver.h:22,
    from C:\Users\105028~1\Desktop\105028~1\Desktop\105028~1\D\B4A_PR~1\B4R\B4R_PR~1\SERVOT~1\Objects\bin\sketch\Adafruit_PWMServoDriver.cpp:18:
    c:\users\105028248.logon\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
    min(const _Tp& __a, const _Tp& __b)
    ^
    c:\users\105028248.logon\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algobase.h:193:5: note: template argument deduction/substitution failed:
    C:\Users\105028~1\Desktop\105028~1\Desktop\105028~1\D\B4A_PR~1\B4R\B4R_PR~1\SERVOT~1\Objects\bin\sketch\Adafruit_PWMServoDriver.cpp:89:22: note: deduced conflicting types for parameter 'const _Tp' ('short unsigned int' and 'int')
    val = min(val, 4095);
    ^
    Multiple libraries were found for "Wire.h"
    Used: C:\Users\105028248.LOGON\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\Wire
    Using library Wire at version 1.0 in folder: C:\Users\105028248.LOGON\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\Wire
    exit status 1
    DEBUG StatusLogger Stopping LoggerContext[name=af3868, org.apache.logging.log4j.core.LoggerContext@91b9b8]
    DEBUG StatusLogger Stopping LoggerContext[name=af3868, org.apache.logging.log4j.core.LoggerContext@91b9b8]...
    TRACE StatusLogger Unregistering 1 MBeans: [org.apache.logging.log4j2:type=af3868]
    TRACE StatusLogger Unregistering 1 MBeans: [org.apache.logging.log4j2:type=af3868,component=StatusLogger]
    TRACE StatusLogger Unregistering 1 MBeans: [org.apache.logging.log4j2:type=af3868,component=ContextSelector]
    TRACE StatusLogger Unregistering 1 MBeans: [org.apache.logging.log4j2:type=af3868,component=Loggers,name=]
    TRACE StatusLogger Unregistering 2 MBeans: [org.apache.logging.log4j2:type=af3868,component=Appenders,name=RollingFile, org.apache.logging.log4j2:type=af3868,component=Appenders,name=Console]
    TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=af3868,component=AsyncAppenders,name=*'
    TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=af3868,component=AsyncLoggerRingBuffer'
    TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=af3868,component=Loggers,name=*,subtype=RingBuffer'
    TRACE StatusLogger Stopping XmlConfiguration[location=jar:file:/C:/Program%20Files%20(x86)/Arduino/lib/pde.jar!/log4j2.xml]...
    TRACE StatusLogger XmlConfiguration notified 2 ReliabilityStrategies that config will be stopped.
    TRACE StatusLogger XmlConfiguration stopping 1 LoggerConfigs.
    TRACE StatusLogger XmlConfiguration stopping root LoggerConfig.
    TRACE StatusLogger XmlConfiguration notifying ReliabilityStrategies that appenders will be stopped.
    TRACE StatusLogger XmlConfiguration stopping remaining Appenders.
    DEBUG StatusLogger Shutting down RollingFileManager C:\Users\105028248.LOGON\AppData\Local\Arduino15/logs/application.log
    DEBUG StatusLogger Shutting down RollingFileManager C:\Users\105028248.LOGON\AppData\Local\Arduino15/logs/application.log
    DEBUG StatusLogger All asynchronous threads have terminated
    DEBUG StatusLogger RollingFileManager shutdown completed with status true
    DEBUG StatusLogger Shut down RollingFileManager C:\Users\105028248.LOGON\AppData\Local\Arduino15/logs/application.log, all resources released: true
    DEBUG StatusLogger Appender RollingFile stopped with status true
    DEBUG StatusLogger Shutting down OutputStreamManager SYSTEM_ERR.false.false
    DEBUG StatusLogger Shut down OutputStreamManager SYSTEM_ERR.false.false, all resources released: true
    DEBUG StatusLogger Appender Console stopped with status true
    TRACE StatusLogger XmlConfiguration stopped 2 remaining Appenders.
    TRACE StatusLogger XmlConfiguration cleaning Appenders from 2 LoggerConfigs.
    DEBUG StatusLogger Stopped XmlConfiguration[location=jar:file:/C:/Program%20Files%20(x86)/Arduino/lib/pde.jar!/log4j2.xml] OK
    DEBUG StatusLogger Stopped LoggerContext[name=af3868, org.apache.logging.log4j.core.LoggerContext@91b9b8] with status true
     
  2. thetahsk

    thetahsk Active Member Licensed User

    Install Adafruit_PWM through Arduino IDE and delete Adafruit_PWMServoDriver.h/Adafruit_PWMServoDriver.cpp in the B4R Lib folder.
     
    janderkan and giggetto71 like this.
  3. giggetto71

    giggetto71 Member Licensed User

    grandissimo! it worked. THANKS!!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice