Closed GSTCH closed 1 year ago
Can you provide more information on what the warning are? (paste them here)
In file included from ... libraries\Adafruit_PWM_Servo_Driver_Library/Adafruit_PWMServoDriver.h:31:0: warning: "PCA9685_MODE1" redefined
... \libraries\Adafruit_Motor_Shield_V2_Library/utility/Adafruit_MS_PWMServoDriver.h:42:0: note: this is the location of the previous definition
In file included from ... libraries\Adafruit_PWM_Servo_Driver_Library/Adafruit_PWMServoDriver.h:31:0: warning: "PCA9685_MODE1" redefined
In file included ... libraries\Adafruit_Motor_Shield_V2_Library/utility/Adafruit_MS_PWMServoDriver.h:42:0: note: this is the location of the previous definition
The following defines are in both libraries ("Adafruit_PWM_Servo_Driver_Library\Adafruit_PWMServoDriver.h" and "Adafruit_Motor_Shield_V2_Library\utility\Adafruit_MS_PWMServoDriver.h"). This gives the above redefined warnings.
Enclose them all with #ifndef e.g for "PCA9685_MODE1"
and it works.
Thanks. Those are just warns. So if the rest of the compilation worked, then the sketch is probably OK.
But would be good to fix this.
Opened a new issue for this here: https://github.com/adafruit/Adafruit_Motor_Shield_V2_Library/issues/50
Closing here. This should be fixed in the Motor Shield library. See issue linked above.
It's a question of the include order. When "Motor Shield library" has been included first, you have to fix it in your library. Else it writes a warning and good software compiles without any warnings. Both has to modify it, or one changes the define names. Both libraries are from Adafruit so why should they no work simultaneously without warnings?
They should. But the fix should be done in the other library (Motor Shield). So an issue has been opened there. It's referenced above.
Warnings when using "Adafruit-PWM-Servo-Driver-Library" and "Adafruit_Motor_Shield_V2_Library" in same sketch. There are only some additional #ifndef and no changes into the logic of the library.