I am wondering if I really need PWM and I2C for this project

I inherited a project that basically drives 2, 12V DC motors either forward or backwards based upon some rather complicated calcs within the sketch.
The motors move just fine if I put a 12V source on either the + or - pin so, couldn't I use any 4 of the GPIO pins and under sketch control, turn them on or off ?

I think that someone here even suggested something similar in another of my aged posts as I was struggling with I2C, etc.

thanks

If you are content for the motors to be either full on or full off there is no need for PWM. Note that analogWrite(pin, 255) is the same as digitalWrite(pin, HIGH) and analogWrite(pin, 0) is the same as digitalWrite(pin, LOW);

I don't understand where I2C comes into the picture.

...R

hextejas:
drives 2, 12V DC motors either forward or backwards

The motors move just fine if I put a 12V source on either the + or - pin so, couldn't I use any 4 of the GPIO pins and under sketch control, turn them on or off ?

You have not said what motor driver you are using. You can't connect a 12V motor directly to an Arduino output pin.
Two pins per motor driver should be sufficient to control most H-Bridge motor drivers. You should be able to get Forward, Backward, and Stop. If you don't need speed control then you don't need PWM pins.

Robin2:
If you are content for the motors to be either full on or full off there is no need for PWM. Note that analogWrite(pin, 255) is the same as digitalWrite(pin, HIGH) and analogWrite(pin, 0) is the same as digitalWrite(pin, LOW);

I don't understand where I2C comes into the picture.

...R

I didn't understand the need for I2C either as both motors can go at full speed just fine.

You have not said what motor driver you are using. You can't connect a 12V motor directly to an Arduino output pin.
Two pins per motor driver should be sufficient to control most H-Bridge motor drivers. You should be able to get Forward, Backward, and Stop. If you don't need speed control then you don't need PWM pins.

The motor driver is a L298N and I don't need speed control.

hextejas:
The motor driver is a L298N and I don't need speed control.

Looks like it has only four input pins (two for each H-Bridge) so the Arduino must be sharing the power ground to act as signal ground. Hook the two inputs of one of the H-Bridges to two digital output pins. Usually HIGH, LOW on the two pins will run the motor one way and LOW, HIGH will run the motor the other way. Either LOW, LOW or HIGH, HIGH will stop the motor.