Arduino R4 Wifi AFMotor library

hi all,

I encounter a compilation error with arduino R4 wifi and AFMotor library. The library seems not ti be compatible?

"AFMotor.h:156:47: error: 'DC_MOTOR_PWM_RATE' was not declared in this scope
AF_DCMotor(uint8_t motornum, uint8_t freq = DC_MOTOR_PWM_RATE);

Another question: is the shield motor L293d compatible with the new Arduino R4?

Thank's

I have exactly the same problem with Arduino R4 Wifi and AFMotor library

Is the AFMotor library in question is the "August 12, 2009 Adafruit Motor shield firmware with basic Microstepping support" for the v1 Adafruit motor shield, which hasn't been updated in, what, 10 years? If so, a cursory look through AFMotor.h reveals the following:

#if defined(__AVR__)
.
.
.
    #define DC_MOTOR_PWM_RATE   MOTOR34_8KHZ    // PWM rate for DC motors
.
.
.
#elif defined(__PIC32MX__)
.
.
.
    #define DC_MOTOR_PWM_RATE   MOTOR34_39KHZ
.
.
.
#endif

Based on that, the library will only work with microcontrollers from the AVR and PIC32 families. The Uno R4 is not a part of either of those families.

Is there a way to modify the library so that it works with the Uno R4?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.