I got Arduino Motor Shield Rev 3 and when I tested it with Arduino Leonardo it worked without issues in both directions and breaking, but when I bought Arduino UNO R4 Wifi, so that it could have Bluetooth without additional space it doesn't work at all, LEDs from motor pins don't even light up. Is there any code difference between these boards, considering that on Uno R4 Wifi website it does say that motor shield is supported? Here's my code (serial prints without issues):
int directionPinA = 12;
int pwmPinA = 3;
int brakePinA = 9;
int directionPinB = 13;
int pwmPinB = 11;
int brakePinB = 8;
void setup() {
// put your setup code here, to run once:
pinMode(directionPinA, OUTPUT);
pinMode(pwmPinA, OUTPUT);
pinMode(brakePinA, OUTPUT);
pinMode(directionPinB, OUTPUT);
pinMode(pwmPinB, OUTPUT);
pinMode(brakePinB, OUTPUT);
Serial.begin(9600);
}
void loop() {
Serial.println("Forward");
forward();
delay(2000);
}
void forward() {
digitalWrite(directionPinA, LOW);
digitalWrite(directionPinB, LOW);
digitalWrite(brakePinA, LOW);
digitalWrite(brakePinB, LOW);
analogWrite(pwmPinA, 500);
analogWrite(pwmPinB, 500);
}
Also note that while the library may be supported, the pin output capacity is only 8mA per pin compared with 20 to 30mA it is safe to run the R4 at. So it depends exactly on your schematic, which we need for a full answer.
There seems little connect between what the marking team says and reality. Because the current capacity in my opinion is a vital incompatibility. I even started a thread about this about six months ago when the boards were first out. Compatability Concern
After contacting support it looks like in the end, I made a mistake, because I didn't use an external power supply with only power coming from my laptop. I just assumed it would work without it since it did on Leonardo. Sorry for all the trouble and thanks for the help!
Also, I just really want to say here that Arduino has a lovely support considering how quickly they respond and how helpful they are!