IBT-2 H-bridge Code Problems

hey there.
I’m having a problem getting my motor to drive. I tried this code below, where I used the void setup from someone else. The motor is just supposed to drive in both directions. But it doesnt work.
Can anybody see where I went wrong here?
Thanks.
Lisa

int RPWM=5;
int LPWM=6;

int L_EN=7;
int R_EN=8;

void setup() {
// put your setup code here, to run once:
for(int i=5;i<9;i++){
pinMode(i,OUTPUT);
}
for(int i=5;i<9;i++){
digitalWrite(i,LOW);
}
delay(1000);
Serial.begin(9600);
}

void loop() {
digitalWrite(R_EN, LOW);
digitalWrite(L_EN, HIGH);
analogWrite(LPWM,255);
delay(200);

digitalWrite(L_EN, LOW);
digitalWrite(R_EN, HIGH);
analogWrite(LPWM,255);
delay(200);
}

Hi,

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html .
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thans.. Tom.. :slight_smile: