Anyways, set the following in setup
void setup{
pinMode(D2, OUTPUT);
pinMode(D3, OUTPUT);
pinMode(D4, OUTPUT);
pinMode(D1, OUTPUT);
//for my setup this is stop
//no motion for right motors
digitalWrite(D2, LOW);
digitalWrite(D3, LOW);
//no motions for left motors
digitalWrite(D4, LOW);
digitalWrite(D1, LOW);
delay(2000)
}
void loop(){
}
This code may seem weird since it's programmed to make the robot to be not moving, BUT this is a good thing, since now we know the state (either left or right) where they are not moving.
From here focus only on one set of motors, for example D2 and D3, and set to different high or low values.
void setup{
pinMode(D2, OUTPUT);
pinMode(D3, OUTPUT);
pinMode(D4, OUTPUT);
pinMode(D1, OUTPUT);
//for my setup this is will move the right motors
//right motors will move in reverse
digitalWrite(D2, HIGH);
digitalWrite(D3, HIGH);
//no motions for left motors
digitalWrite(D4, LOW);
digitalWrite(D1, LOW);
delay(2000)
}
void loop(){
}
By the way, D1, D2, D3, D4 are constants built in the arduino IDE, so don't worry about making variables for them
pwma D1 5 left side
pwmb D2 4 right side
DA D3 0 right side
DB D4 2 left side
Left column I think for node mcu version2(maybe),
2nd column for nodemcu v3,
3rd are what the gpio values are if serial.println() them in arduino ide
Last column are for side the motors control (for my setup).
Also you might need to manual spin the motors. Spinning them manually till it starts spinning on its own (maybe something about the motor brushes, but what I stated here is about the motor and not the motor shield). I had to do that with mine and then it started spinning (or maybe it was issues in my wiring?).
Also you need to buy jumpers, mine didn't come with one, so Vin and VM can be joined together and share the same power source.
Also it's possible the esp32 lora might work with this (but the pins will be different)