Arduino uno wifi rev 2 not working with L298n motor controller

Hi everybody!
I have a programming problem.
I tried to upload this code to the Arduino uno wifi 2, but it says this error code:

 exit status 1  call to 'AF_DCMotor::AF_DCMotor(uint8_t, uint8_t)' uses the default argument for parameter 2, which is not yet defined  
exit status 1
call to 'AF_DCMotor::AF_DCMotor(uint8_t, uint8_t)' uses the default argument for parameter 2, which is not yet defined
Code: 
#include <AFMotor.h>

AF_DCMotor motor(3);
AF_DCMotor motor2(4);

void setup() {}

void loop() {
  motor.setSpeed(200);
  motor2.setSpeed(200);


  motor.run(FORWARD);
  motor2.run(FORWARD);
  delay(2000);

  motor.run(RELEASE);
  motor2.run(RELEASE);
  delay(1000);
}
~~~~~~~

What can be the problem?(I used the Arduino uno wifi rev 2 because it was the only one I had at home

The constructor expects 2 values. Consult the library docs.

1 Like

But this code works flawlessly with Arduino mega 2560, with 1 value
It just doesn't work with wifi rev 2 for some reason

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