//Connect M1A to D12 &  M1B to D14

// Define the motor control pins
const int motorPin1 = 12;  // Connect to IN1 on the motor driver
const int motorPin2 = 14;  // Connect to IN2 on the motor driver

void setup() {
  // Set motor control pins as outputs
  pinMode(motorPin1, OUTPUT);
  pinMode(motorPin2, OUTPUT);

  // Initialize Serial communication for debugging
  Serial.begin(9600);
}

void loop() {
  // Forward motion
  digitalWrite(motorPin1, HIGH);
  digitalWrite(motorPin2, LOW);

  // Wait for a few seconds
  delay(2000);

  // Stop the motor
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, LOW);

  // Reverse motion
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, HIGH);

  // Wait for a few seconds
  delay(2000);

  // Stop the motor
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, LOW);

  // You can add more control logic as needed
}
