Ok, thank you for looking it up and glad to hear that I’m not the only one that thinks that enable_pin doesn’t make sense. It’s just a little bit annoying that I now have to use 4 PWMs to control 2 linear motors. I was hoping to use 1 PWM per motor and controlling direction by using the EN pins. But at least it works now.
For anyone else reading, here’s what I did:
I connected the both L_EN and R_EN to 3.3v and the LPWM and RPWM to GPIO4 and 5 per the above suggestions on my ESP32-S3-WROOM-1 (board: esp32-s3-devkitc-1), using ledc as the PWM platform. This is what I’ve put in as the definition that now lets me successfully control the both motors run via 2 bts7960 modules:
output:
# east - west
- platform: ledc
frequency: 25000Hz
pin: GPIO04
id: motor_ew_lpwm
- platform: ledc
frequency: 25000Hz
pin: GPIO05
id: motor_ew_rpwm
# north - south
- platform: ledc
frequency: 25000Hz
pin: GPIO06
id: motor_ns_lpwm
- platform: ledc
frequency: 25000Hz
pin: GPIO07
id: motor_ns_rpwm
fan:
# east - west
- platform: hbridge
id: motor_ew
name: "Motor E-W"
pin_a: motor_ew_lpwm
pin_b: motor_ew_rpwm
decay_mode: slow
speed_count: 100
# north - south
- platform: hbridge
id: motor_ns
name: "Motor N-S"
pin_a: motor_ns_lpwm
pin_b: motor_ns_rpwm
decay_mode: slow
speed_count: 100
The cover platform is probably a better fit for what I want to do, so I am going to try that next. But this was the first thing I encountered and I now know I can successfully control the motors.