I'm using a dual h bridge to control two dc motors on an inverted pendulum (cart-pole system). At the moment, I have to send two different pulse width modulated signals to the two enable pins to control the two motor speeds and four digital write commands to control the directions.
Ideally, I want to switch the two motors simultaneously in the same direction and with the same speed. So, I'd like to be able to control both motors' speeds with only one pulse width modulation signal and control both motor directions with only two digital write commands.
Is there a way I can do with with Arduino? Can one PWM signal from a single arduino pin be sent to two enable pins at the same time? Can the same be done for a single digital output pin? If so, how can I accomplish this?