Yes. It is connected according to the given typical application connection in datasheet. As well as I have drv8234 evm, the code is not working on that as well if I only connect SDA, SCL to esp32 and give A0, A1 ground and have common ground.
Can you please try this code? It should control only the motor output in PH/EN mode. Is this board recognized by I2C scanner?
#include <Wire.h>
#define ADDR 0x60
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Wire.begin();
writeI2CByte(0x09, 0b11100000);//BIT7 from CONFIG0 set to 1 in order to enable output EN_OUT
writeI2CByte(0x0D, 0b00110100);//CONFIG4, 0011 default 0 PH/EN 1 I2C X EN_IN1 X PH_IN2, where x controls those inputs from i2c
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println(">>forward>>");
writeI2CByte(0x0D, 0b00110111);//forward
delay(5000);
Serial.println("<reverse<<");
writeI2CByte(0x0D, 0b00110110);//reverse
delay(5000);
Serial.println("><brake><");
writeI2CByte(0x0D, 0b00110100);//brake
delay(5000);
}
void writeI2CByte(byte data_addr, byte data){
Wire.beginTransmission(ADDR);
Wire.write(data_addr);
Wire.write(data);
Wire.endTransmission();
}
This should be correct now. I forgot the binary for all data (0b).