Hello
I got the Arduino Uno and the Arduino Motor Shield Rev3 for my project, and the code from the docs of motor shield worked perfectly, though because I needed BLE functionality I got ESP32 NodeMCU Wemos D1 R32 that is in theory compatible with Uno. All of the pins fit and I adjusted the pins of the sketch to those of the new board and it just doesn't work. None of the lights for motors light up on the shield and I'm wondering if it's just because those boards aren't compatible with each other. Could it be any other issue?
Code:
int directionPinA = 19;
int pwmPinA = 25;
int brakePinA = 13;
int directionPinB = 18;
int pwmPinB = 23;
int brakePinB = 12;
void setup() {
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();
}
void forward() {
digitalWrite(directionPinA, LOW);
digitalWrite(directionPinB, LOW);
digitalWrite(brakePinA, LOW);
digitalWrite(brakePinB, LOW);
//set work duty for the motor
analogWrite(pwmPinA, 500);
analogWrite(pwmPinB, 500);
}
An ESP32 runs on 3.3V
an Arduino Uno runs on 5V.
Yeah
I know, that's exactly why instead of reusing esp32-cam with serial I just got this one. Also, the IOREF pin on this board is 5V, so doesn't this mean that this one runs on 5V?
When it comes to the manufacturer there's not really much info (I can't even find listings of it outside aliexpress and some small dropshipping stores), only on the listing there's a link to a hackster page with some basic code for built-in led and serial which works without issues.
On an ESP32 the function for pwm is different than on Arduino Unos
this might be a reason.
Sounds likely. Considering it's not some original board and it has a few quirks I think I'll refund this one and go back to looking for alternatives to make uno wireless without making the project too complicated.