Consider the following:
#define IN1 9
#define IN2 10
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
void LeftMotor(Direction direction)
{
digitalWrite(IN1, direction == Forward ? LOW : HIGH);
digitalWrite(IN2, direction == Forward ? HIGH : LOW);
}
How can iI modify the LeftMotorLeftMotor method to achieve the same result without using digitalWrite?