Ardumoto only works in one direction! :(

Hello.

I have the ardumoto connected to the arduino with wires (not mounted) but i can only make either motor work when the direction pin is set to high.

somehow managed to break my arduino pins 13 and 3 but thats besides the point but i have pins 13, 12, 11, 10 on the motor shield connected to arduino 9, 12, 11, and 10 respectively, the shield gnd connected to the same gnd on the arduino, and the vin and gnd on the shield connected to an external power supply.

below is my code (some bits are skipped out but they dont make a difference):

int dirpin1 = 12;            // Direction 1 on DC motor
int speedpin1 = 10;            // Speed 1 on DC motor
int speedpin2 = 11;              // Speed 2 on Dc motor
int dirpin2 = 9;            // Direction 2 on DC motor


  pinMode(dirpin1, OUTPUT);
  pinMode(speedpin1, OUTPUT);
  pinMode(speedpin2, OUTPUT);
  pinMode(dirpin2, OUTPUT);


  if (data[0] == 'a')
  {
    digitalWrite(dirpin1, HIGH);
    analogWrite(speedpin2, 0);
    delay(10);
    int Ans = strtol(data+1, NULL, 10);
    analogWrite(speedpin1, Ans);
  }
  
  // DC anticlockwise
  if (data[0] == 'c')
  {
    digitalWrite(dirpin1, LOW);
    analogWrite(speedpin2, 0);
    delay(10);
    int Ans = strtol(data+1, NULL, 10);
    analogWrite(speedpin1, Ans);
  }

only one motors code is above. i send commands such as 'a255' or 'c128' to make the motor go in some direction at some speed. the problem is that both motors work when the dir pin is high, but nothing happens (no dir led lights) when it is set on low.

i get around 5 V on the arduino on high and 10-20mV on low. can anyone help please? thanks

anyone?

The code looks sort of OK but it is not a full sketch so I can't see if you are doing anything silly that would stop it from working. However, you are using dirpin1 and speedpin2 to control the motor so maybe that is your problem.