void setup() {
  // 1. Set up your 40 kHz PWM Pins
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);

  // 2. Set up and ACTIVATE the Enable Pins (Fix for Problem 2)
  pinMode(7, OUTPUT); // Connected to ENA
  pinMode(8, OUTPUT); // Connected to ENB
  digitalWrite(7, HIGH); // Turns on Channel A
  digitalWrite(8, HIGH); // Turns on Channel B

  // --- Your existing Timer 1 Configuration ---
  TCCR1A = 0;
  TCCR1B = 0;
  TCNT1  = 0;
  TCCR1A = _BV(COM1A1) | _BV(COM1B1) | _BV(COM1B0) | _BV(WGM11);
  TCCR1B = _BV(WGM13) | _BV(CS10); 
  ICR1 = 200;
  OCR1A = 100;
  OCR1B = 100;
}

void loop() {
  // Timer runs in hardware
}