I have Arduino Motor Shield R3. I've got both channels plugged into motors, and 12V power supply. I've posted my code below. Channel A works fine, but Channel B won't work at all. I know the Channel's not fried because when I put both + terminals into same motor and both - terminals into the other motor, the lights for Channel B light up. But in that case, none of the motors spin. In proper wiring, Channel A works and its lights turn on, but Channel B lights don't turn on at all. Why isn't it working I think I'm doing everything correct?
void setup() {
//Setup Channel A
pinMode(12, OUTPUT); //Initiates Motor Channel A pin
pinMode(9, OUTPUT); //Initiates Brake Channel A pin
pinMode(3,OUTPUT);
//Setup Channel B
pinMode(13, OUTPUT); //Initiates Motor Channel A pin
pinMode(8, OUTPUT); //Initiates Brake Channel A pin
pinMode(11,OUTPUT);
}
void loop(){
//Motor A forward @ full speed
digitalWrite(12, HIGH); //Establishes forward direction of Channel A
digitalWrite(9, LOW); //Disengage the Brake for Channel A
analogWrite(3, 255); //Spins the motor on Channel A at full speed
//Motor B backward @ half speed
digitalWrite(13, HIGH); //Establishes backward direction of Channel B
digitalWrite(8, LOW); //Disengage the Brake for Channel B
analogWrite(11, 255); //Spins the motor on Channel B at half speed
delay(3000);
digitalWrite(9, HIGH); //Engage the Brake for Channel A
digitalWrite(8, HIGH); //Engage the Brake for Channel B
}